Importer SDK DLL - Visual C++

Discuss and ask questions about CAD DLL (CAD Image DLL, CAD Importer DLL).

Moderators: SDS, support, admin

Post Reply
KCMPE
Posts: 3
Joined: 14 Jun 2005, 21:40

Importer SDK DLL - Visual C++

Post by KCMPE » 14 Jul 2005, 08:05

I have the following code :

<b>
DXF = DXFCreate(NULL, "rectangle.dxf\0");
nLayers = DXFLayerCount(DXF);
printf("there are %d layers\n", nLayers);
</b>

now I did not include the initialization etc, however it does work.

So far so good, DXFLayerCount will retrieve the correct number of layers

Now, here is the part that is puzzling me (relentlessly!)

<b>
DXFLayer(DXF, 0, &DXFinfo); // DXFInfo is a DXFDATA type
</b>

when I execute this command (and change the layer number) I cannot get a list of entities.

I can sometimes get back the Tag number of 4 (dxf layer) but never a count of entities.

Can I get a little bit of help as to what I'm doign wrong here? I just need to walk the layers and entities and get the coordinates/attributes for each of the entities. I have tried a few things, and now all I can think of is that I am forgetting something major.

Thank you for the help, it is much appreciated and very important.

regards,

p.s. although I did not buy DXF Import VCL, I am still going to purchase on of your products, just as soon as I can prove to my employer that it will suite my needs.

KCMPE
Posts: 3
Joined: 14 Jun 2005, 21:40

Post by KCMPE » 17 Jul 2005, 21:40

Nevermind ...

I just needed to implement a CALLBACK function so that DXFEnum could fire back a PARAM and read the entities, works like a charm now.

Thanks to anyone that tried to help.

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

Post by support » 18 Jul 2005, 16:23

Hi,

DXFLayerCount returns the number of layers.
DXFLayer fills DXFDATA structure (or DXFinfo structure in described above example) with properties of the layer defined by input number parameter.
After calling DXFLayer function DXFDATA.Text contains the name of the desired layer.
Each entity contains in DXFDATA.Layer a name of a layer to which it belongs.
It is necessary to create DXFPROC function for
int DXFEnum(
HANDLE hObject,
int nEnumAll,
DXFPROC lpDXFProc,
LPARAM lParam);
which will sort entities by its layer name and get its coordinates/attributes as usual from DXFDATA.

Sergey.

please post questions to the forum or write to support@cadsofttools.com

Post Reply