Create Entity in runtime Layers

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
fmonteiro
Posts: 6
Joined: 09 Apr 2014, 18:32

Create Entity in runtime Layers

Post by fmonteiro » 14 Apr 2014, 17:51

If I create a line it comes in the default layer.

Dim xLine As New CADLine
xLine.Point = New DPoint(10, 10, 0)
xLine.Point1 = New DPoint(20, 20, 0)
xLine.Color = Color.Red
xLine.LineWeight = Convert.ToSingle(0.5)
cadImageFld.Converter.GetSection(ConvSection.Entities).AddEntity(xLine)
cadImageFld.Converter.OnCreate(xLine)
cadImageFld.Converter.Loads(xLine)


I also create a second layer:

Dim entLayer As New CADLayer()
entLayer.Name = "MyLayer"
entLayer.Visibility = True
entLayer.Loaded(Me.cadImageFld.Converter)
Me.cadImageFld.Converter.Layers.Add(entLayer)
Me.cadImageFld.Converter.OnCreate(entLayer)
Me.AddRecordToLayerList("MyLayer", Color.Blue, True, False)


I can see now in the LayerForm this new Layer, but I do not know how to create an Entity (for example Line) in this new layer.

Regards.

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Create Entity in runtime Layers

Post by support » 14 Apr 2014, 19:42

Hello,

It's possible to set a layer for newly created entity using CADEntity.Layer property.


Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply