Line type check

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
larios
Posts: 3
Joined: 27 Jan 2022, 16:02

Line type check

Post by larios » 11 May 2022, 19:19

Hello, I am new to CAD file management, and my question is:
How can I determine the line type af an entity ?

I have tried with the "lineEnt(I).LineType.DashStyle" property, but it has always "Solid {0}" value even if the shape has dash dot line.

The "lineEnt(I).LineType.EntName" seems to be better because value is string "Continuous" in case of continuous line or "CENTERX2" in case of dash dotted line, is this the correct property to check ?

I think it is not a good idea to check a string content for evaluate a property like this, i do not know how many different values the property "lineEnt(I).LineType.EntName" can have.

Thank you

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

Re: Line type check

Post by support » 12 May 2022, 17:44

Hello,
LineType.EntName refers to a line type name, a style. To find other styles in an open drawing, you can use

Code: Select all

cadImage.converter.GetSection(ConvSection.LTypes).List
To create a new style, you can use
private void AddLineType()
        {
            CADLineType vLineType = new CADLineType();
            vLineType.Name = cnstLTypeName;
            vLineType.Lines.AddTick(25);
            vLineType.Lines.AddTick(-12.5);
            AddEntToSection(ConvSection.LTypes, vLineType);
        }
To find a line type by name, you can use

Code: Select all

CADLineType findLType = cadImage.converter.LTypeByName(name);
Maria
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply