Adding TsgCADMLine ?
Moderators: SDS, support, admin
Adding TsgCADMLine ?
Hi,
I'd like to add a MultiLine (for example Double) entity to CAD Image but I couldn't find a demo or explanation, could you give me an simple example
Bilal.
I'd like to add a MultiLine (for example Double) entity to CAD Image but I couldn't find a demo or explanation, could you give me an simple example
Bilal.
Re: Adding TsgCADMLine ?
Hello Bilal.
Here is the snippet that shows MultiLine creation. The number of lines in MultiLine defined by TsgMLineStyle.Entries. TsgMVertex.Point and TsgMVertex.Direction define MLINE geometry. Please note, MultiLine can't be exported to DXF with VCL export component current version.
Alexander.
Here is the snippet that shows MultiLine creation. The number of lines in MultiLine defined by TsgMLineStyle.Entries. TsgMVertex.Point and TsgMVertex.Direction define MLINE geometry. Please note, MultiLine can't be exported to DXF with VCL export component current version.
Code: Select all
style := TsgMLineStyle.Create();
style.Name := 'my_style';
M := TsgMLineEntry.Create;
M.Offset := 5;
M.Color := clBlue;
style.AddEntity(M);
M := TsgMLineEntry.Create;
M.Offset := 15;
M.Color := clRed;
style.AddEntity(M);
Img.Converter.Loads(style);
Img.Converter.OnCreate(style);
Img.Converter.Sections[csMLineStyles].AddEntity(style);
mline := TsgCADMLine.Create();
mline.Scale := MakeFPoint(1, 1, 1);
mline.Style := style;
mline.Flags := 1;
mline.Justify := 0;
mvert := TsgMVertex.Create();
mvert.Point := MakeFPoint(500, 0, 0);
mvert.Direction := MakeFPoint(100, 100, 0);
mvert.Miter := MakeFPoint(0.0, 20.0, 0.0);
mvert.NewList();
mvert.NewList();
mvert.NewList();
mvert.Params[0, 0] := 0.0;
mvert.Params[0, 1] := 1.0;
mvert.Params[1, 0] := 1.0;
mvert.Params[1, 1] := 1.0;
mline.AddEntity(mvert);
mvert := TsgMVertex.Create();
mvert.Point := MakeFPoint(0, 500, 0);
mvert.Direction := MakeFPoint(100, 100, 0);
mvert.Miter := MakeFPoint(0.0, 20.0, 0.0);
mvert.NewList();
mvert.NewList();
mvert.NewList();
mvert.Params[0, 0] := 0.0;
mvert.Params[0, 1] := 1.0;
mvert.Params[1, 0] := 1.0;
mvert.Params[1, 1] := 1.0;
mline.AddEntity(mvert);
mvert := TsgMVertex.Create();
mvert.Point := MakeFPoint(-300, 100, 0);
mvert.Direction := MakeFPoint(100, 200, 0);
mvert.Miter := MakeFPoint(0.0, 20.0, 0.0);
mvert.NewList();
mvert.NewList();
mvert.NewList();
mvert.Params[0, 0] := 0.0;
mvert.Params[0, 1] := 1.0;
mvert.Params[1, 0] := 1.0;
mvert.Params[1, 1] := 1.0;
mline.AddEntity(mvert);
Img.Converter.Loads(mline);
Img.Converter.OnCreate(mline);
Img.CurrentLayout.AddEntity(mline);
Img.GetExtents();
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support