TsgDXFAttdef and TsgDXFAttrib

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

Moderators: SDS, support, admin

Post Reply
Jourde
Posts: 33
Joined: 10 Sep 2004, 10:33
Location: France
Contact:

TsgDXFAttdef and TsgDXFAttrib

Post by Jourde » 08 Jan 2007, 12:34

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!

Goubet
Posts: 2
Joined: 10 Jan 2007, 13:08
Location: France

Post by Goubet » 10 Jan 2007, 13:10

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>

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

Post by support » 15 Jan 2007, 10:44

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

Post Reply