Linetype and Lineweigth

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
creepin
Posts: 19
Joined: 20 Nov 2010, 00:27

Linetype and Lineweigth

Post by creepin » 24 Jan 2011, 16:32

Hello!

I got two questions:

First one:
How can I assign the lineweight of the layer to an entity? Assigning Layercolor works with
newestEntity.Color = CADConst.clByLayer
Is there a similar way for lineweight?

Second Question:
I tried to assign a certain linetype to an entity. I made it the following way:

dim lt_dash as CADLineType = New CADLineType
lt_dash.Name = "Dash"
lt_dash.Lines.AddTick(5)
lt_dash.Lines.AddTick(-0.5)
Me.cadImageFld.Converter.GetSection(CADImport.FaceModule.ConvSection.LTypes).AddEntity(lt_dash)
CType(newestEntity, CADPolyLine).SetLType(lt_dash)

Checking the entity's linetype property in debugging shows the correct linetype, but the line is still solid in the picturebox.

Thanks a lot!

Evgeny Chuzhakin
Posts: 12
Joined: 14 Nov 2008, 09:45

Re: Linetype and Lineweigth

Post by Evgeny Chuzhakin » 28 Jan 2011, 17:18

Hi!

1. Unfortunately there is no such functionality for lineweight.
2. It is nesessary to load linetype (Loads method).
Also if LinetypeScale is not correct, when line becomes automatic solid. Please use the following code to load lilnetype:

Code: Select all

 Dim lt_dash As CADLineType = New CADLineType
        lt_dash.Name = "Dash"
        lt_dash.Lines.AddTick(5)
        lt_dash.Lines.AddTick(-5)

        Me.cadImageFld.Converter.Loads(lt_dash)
        Me.cadImageFld.Converter.GetSection(CADImport.FaceModule.ConvSection.LTypes).AddEntity(lt_dash)

creepin
Posts: 19
Joined: 20 Nov 2010, 00:27

Re: Linetype and Lineweigth

Post by creepin » 28 Jan 2011, 18:48

Thank you, linetype works now properly.
According the Lineweight: I can assign an entity the lineweight of its layer in the propertydialog in editor demo. Can't there be any possibility to do this by program code?
Otherwise i wont assign the lineweight "byLayer", but assign the direct value of the layerlineweight to the entity.

Thnaks a lot!

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

Re: Linetype and Lineweigth

Post by support » 01 Feb 2011, 12:42

Hello.
Current CAD Import .NET version use internal constants to set "ByLayer"/"ByBlock" value to lineweight property from the PropertyGrid window. These constants can't be used. However you can set "ByLayer" or "ByBlock" values to lineweight programmatically using the values: -1(ByLayer) or -2(ByBlock).

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

Post Reply