Draw a Polyline as a dash dotted line

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
Klemens
Posts: 4
Joined: 01 Dec 2008, 20:36

Draw a Polyline as a dash dotted line

Post by Klemens » 16 Dec 2008, 21:21

Hello support,

how do I can set attributes of a polyline to draw it as a dash dotted line?

Thanks for help.
Kind regards
Klemens

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

Re: Draw a Polyline as a dash dotted line

Post by support » 18 Dec 2008, 16:25

Hello Klemens,
Here is a solution for CADImportVCL 6.x.

If the file is loaded you can choose line type from the existent if you know its name (e.g. you know your file contains 'DashDot' line type), and set it to the entity:

YourPolyline.SetLType(YourCADFile.Converter.LTypeByName('DashDot'));
YourCADFile.Converter.Loads(YourPolyline);// reloading

If the file is loaded (YourCADFile variable), but there is no required line type, you should create this line type and set it to the entity:

...
{ Adding the new linetype to image-converter }
vLType := TsgDXFLineType.Create;
vLType.Name := 'DashDot';
vLType.Lines.Scale := 1; // linetype scale
vLType.Lines.AddTick(0.25); // length of the "solid" part of a line
vLType.Lines.AddTick(-0.125); // length of the "empty" part of a line
vLType.Lines.AddTick(0); // dot
vLType.Lines.AddTick(-0.125); // length of the "empty" part of a line
YourCADFile.Converter.Loads(vLType);
YourCADFile.Converter.Sections[csLTypes].AddEntity(vLType);
YourPolyline.SetLType(YourCADFile.Converter.LTypeByName('DashDot'));
YourCADFile.Converter.Loads(YourPolyline);// reloading

You can find the similar samples in:
1. CADtoDXFExport Demo
2. demo package: ..\Demos\TextChange+Color2LineWeight\Unit1.pas (procedure TForm1.sbMergingTestClick(Sender: TObject);)

Regards,
Sergey
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply