Page 1 of 1
Creating new dxf with xdata
Posted: 19 Dec 2022, 13:12
by Timo
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
Re: Creating new dxf with xdata
Posted: 20 Dec 2022, 09:25
by support
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,