Creating new dxf with xdata

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

Moderators: SDS, support, admin

Post Reply
Timo
Posts: 10
Joined: 14 Oct 2009, 14:01

Creating new dxf with xdata

Post by Timo » 19 Dec 2022, 13:12

Hi

I have to create DXF file which must have some extdata/xdata strings assigned to objects (polyline, polygon and region). I have tried to use SetExtData, but it doesn't seems to work as I expected.
Could you give some example how to do this?

I'am using CAD VCL Enterprise 14.0

-- Timo Kervinen

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

Re: Creating new dxf with xdata

Post by support » 20 Dec 2022, 09:25

Timo wrote:
19 Dec 2022, 13:12
Hi

I have to create DXF file which must have some extdata/xdata strings assigned to objects (polyline, polygon and region). I have tried to use SetExtData, but it doesn't seems to work as I expected.
Could you give some example how to do this?

I'am using CAD VCL Enterprise 14.0

-- Timo Kervinen
Hello Timo,

First you should add the ExtData unit to the Uses section, then create an object:

Code: Select all

vData:= TsgCADExtendedData.Create(acR14);
add a string to it:

Code: Select all

 vData.AddString(1000, 'my entity');
After it you add vData through the SetExtData method in vLine (class instance of TsgDXFLine):

Code: Select all

 vLine.SetExtData(vData); // setting vData
Code example;

Code: Select all

  vData:= TsgCADExtendedData.Create(acR14); // acR14 -- TsgDWGVersion
  vData.AddString(1000, 'my entity');   // adding a String type exData
  vLine.SetExtData(vData); // setting vData
Best wishes and Merry Christmas,
Catherine,
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply