Page 1 of 1

Linetype and Lineweigth

Posted: 24 Jan 2011, 16:32
by creepin
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!

Re: Linetype and Lineweigth

Posted: 28 Jan 2011, 17:18
by Evgeny Chuzhakin
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)

Re: Linetype and Lineweigth

Posted: 28 Jan 2011, 18:48
by creepin
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!

Re: Linetype and Lineweigth

Posted: 01 Feb 2011, 12:42
by support
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.