Page 1 of 1
Draw a Polyline as a dash dotted line
Posted: 16 Dec 2008, 21:21
by Klemens
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
Re: Draw a Polyline as a dash dotted line
Posted: 18 Dec 2008, 16:25
by support
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