Nevron Forum

Adding a Custom Shape to a Diagram from a Library

https://www.nevron.com/Forum/Topic7590.aspx

By Joseph Vogel - Friday, March 15, 2013

I am a bit confused on how to load a custom shape from a library and apply styles.. and custom text to it.

Dim master As NMaster = DirectCast(Form1.omniShapeLibrary.GetChildByName("Subject"), NMaster)

I would think like all other Factory Shapes from Nevron there would be a way to convert the NMaster object
to a NShape object and then perform the necessary styling, text manipulation etc.. to it.

From the sample code I see that

Dim myDoc As NDrawingDocument = New NDrawingDocument()
master.CreateInstance(myDoc, New NPointF(100, 100))

something like this has to happen but Iam not sure how to manipulate the object after this. I was expecting something similiar to:

Dim factory As NFlowChartingShapesFactory = New NFlowChartingShapesFactory(theDoc)
Dim shape As NShape = factory.CreateShape(CInt(Fix(flowChartShape)))

Dim protection As NAbilities = shape.Protection
protection.InplaceEdit = True
protection.Delete = True
protection.Select = False
shape.Protection = protection
theDoc.ActiveLayer.AddChild(shape)
where I then could manipulate.. protections.. specifying a value of Tag and stylesheets programmatically.
It seems that I am missing something. Anyway to get the custom shape from a library into a NSHAPE?

Any help would be appreciated.
Thanks,

Joseph Vogel

By Nevron Support - Friday, March 15, 2013

Hi,

Please, take a look at this online documentation topic. It explains what masters are and demonstrates how to create them.