Symbol Model programatically

This may be a stupid question. I have created a Symbol Model for an object using the symbol designer, set the plugin properties, saved the symbol pallete and loaded into the designer. Everything works fine when dragging a new symbol model to the diagram. What I can''t figure out is how to programatically get a reference to the symbol model already loaded in the pallete and create a symbol based off this model. I can easily create a new instance of the symbol itself and add it to the diagram but it doesn''t have the symbol model attached to it. Thanks, Darren

1 Reply

AD Administrator Syncfusion Team September 15, 2005 09:00 PM UTC

Hi Darren, You can use the SymbolPalette.GetChildByName(string) method to obtain the SymbolModel that you are interested in. Once you have the SymbolModel, you can call SymbolModel.CreateSymbol() to instantiate the symbol instance. If you are using the PaletteGroupView control, the PaletteGroupView.Palette property will let you retrieve the SymbolPalette loaded into the control. The following code should give you an idea, // Obtain the ''Start'' SymbolModel and instantiate the symbol SymbolModel symmodel = this.GetSymbolModel(palette,"Start"); Symbol sym = symmodel.CreateSymbol(); // Get the SymbolModel from the SymbolPalette public SymbolModel GetSymbolModel(SymbolPalette palette, string symbolName) { INode symmodel = palette.GetChildByName(symbolName); if(symmodel != null) return (SymbolModel)symmodel; return null; } Thanks, Prakash Surendra Syncfusion Inc.,

Loader.
Up arrow icon