Draw a Polyline as a dash dotted line
Moderators: SDS, support, admin
Draw a Polyline as a dash dotted line
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
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
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
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
Chat support on Skype: cadsofttools.support