TsgDXFAttdef and TsgDXFAttrib
Moderators: SDS, support, admin
TsgDXFAttdef and TsgDXFAttrib
First thanks, we receive the update of the compoment.
I try to add dxfattdef and attrib in a insert.
But i found nowhere a sample !
can you say how to do ?
Thanks
ps : ok i found, but with this:
vAttrib := TsgDXFAttrib.Create;
vAttrib.Point := MakeFPoint(10, 10, 0);
vAttrib.Tag := 'Affectation';// = vAttdef.Tag
vAttrib.Text := t1;
vAttrib.Height := 20;
vAttrib.Visible:=false;
if Assigned(Img_Travail.Converter.OnCreate) then Img_Travail.Converter.OnCreate(vAttrib);
Img_Travail.Converter.Loads(vAttrib);
vInsert.Attribs.Add(vAttrib);
the attrib is show in the draw!
I try to add dxfattdef and attrib in a insert.
But i found nowhere a sample !
can you say how to do ?
Thanks
ps : ok i found, but with this:
vAttrib := TsgDXFAttrib.Create;
vAttrib.Point := MakeFPoint(10, 10, 0);
vAttrib.Tag := 'Affectation';// = vAttdef.Tag
vAttrib.Text := t1;
vAttrib.Height := 20;
vAttrib.Visible:=false;
if Assigned(Img_Travail.Converter.OnCreate) then Img_Travail.Converter.OnCreate(vAttrib);
Img_Travail.Converter.Loads(vAttrib);
vInsert.Attribs.Add(vAttrib);
the attrib is show in the draw!
To create insert I use this and it works very well
<i><i>vInsert := TsgDXFInsert.Create;
vBlock := TsgDXFBlock.Create;
vBlock.Name := 'AttribsTest';
vAttdef := TsgDXFAttdef.Create;
vAttdef.Tag := 'ATTDEF#1';
vAttdef.Text := 'This is ATTDEF text';
vAttdef.Height := 1;
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vAttdef);
vCADFile.Converter.Loads(vAttdef);
vBlock.AddEntity(vAttdef);
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vBlock);
vCADFile.Converter.Loads(vBlock);
vCADFile.Converter.Sections[csBlocks].AddEntity(vBlock);
vInsert.Block := vBlock;
vInsert.Point := MakeFPoint(90, 90, 0);
vAttrib := TsgDXFAttrib.Create;
vAttrib.Point := MakeFPoint(10, 10, 0);
vAttrib.Tag := 'ATTDEF#1';// = vAttdef.Tag
vAttrib.Text := 'ATTRIB text!';
vAttrib.Height := 20;
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vAttrib);
vCADFile.Converter.Loads(vAttrib);
vInsert.Attribs.Add(vAttrib);
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vInsert);
vCADFile.Converter.Loads(vInsert);
vCADFile.Converter.Sections[csEntities].AddEntity(vInsert);</i></i>
<i><i>vInsert := TsgDXFInsert.Create;
vBlock := TsgDXFBlock.Create;
vBlock.Name := 'AttribsTest';
vAttdef := TsgDXFAttdef.Create;
vAttdef.Tag := 'ATTDEF#1';
vAttdef.Text := 'This is ATTDEF text';
vAttdef.Height := 1;
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vAttdef);
vCADFile.Converter.Loads(vAttdef);
vBlock.AddEntity(vAttdef);
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vBlock);
vCADFile.Converter.Loads(vBlock);
vCADFile.Converter.Sections[csBlocks].AddEntity(vBlock);
vInsert.Block := vBlock;
vInsert.Point := MakeFPoint(90, 90, 0);
vAttrib := TsgDXFAttrib.Create;
vAttrib.Point := MakeFPoint(10, 10, 0);
vAttrib.Tag := 'ATTDEF#1';// = vAttdef.Tag
vAttrib.Text := 'ATTRIB text!';
vAttrib.Height := 20;
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vAttrib);
vCADFile.Converter.Loads(vAttrib);
vInsert.Attribs.Add(vAttrib);
if Assigned(vCADFile.Converter.OnCreate) then
vCADFile.Converter.OnCreate(vInsert);
vCADFile.Converter.Loads(vInsert);
vCADFile.Converter.Sections[csEntities].AddEntity(vInsert);</i></i>
Hello!
The following link contains <b>CAD to DXF Export</b> beta version:
http://www.cadsofttools.com/download/CADtoDXF.zip
Please find in the package CADtoDXF_demo (in the ..\CADtoDXF\Demos\CADtoDXF_demo\.. folder). This demo contains examples of adding LINE, POLYLINE, ARC, CIRCLE, SOLID, HATCH, INSERT with ATTRIBs and the BLOCK with ATTDEFs.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
The following link contains <b>CAD to DXF Export</b> beta version:
http://www.cadsofttools.com/download/CADtoDXF.zip
Please find in the package CADtoDXF_demo (in the ..\CADtoDXF\Demos\CADtoDXF_demo\.. folder). This demo contains examples of adding LINE, POLYLINE, ARC, CIRCLE, SOLID, HATCH, INSERT with ATTRIBs and the BLOCK with ATTDEFs.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com