CAD importer SDK DLL VB

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

Moderators: SDS, support, admin

Post Reply
Daave
Posts: 4
Joined: 12 Apr 2005, 11:27
Location: France
Contact:

CAD importer SDK DLL VB

Post by Daave » 12 Apr 2005, 11:36

I have to extract the layer, the label, the text attribute question, etc of attributes bloc from a dwg using Visual Basic.
I tried to use the demo DXF.DLL, (modifiing your demoVB script) but:
- I can"t see label and text attribute question in the Structure recovered by DXFENUM.
-The layer and the text value are filled with "?"

Is it because it 's demo DLL ?

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

Post by support » 13 Apr 2005, 15:40

All functions of DXF.dll return a pointer to ANSI string.
Visual Basic works with Unicode strings, it does not support PChar directly.
It is necessary to convert the string by StrConv function with vbUnicode parameter to see correct text.

For example:

' Dim S As String
S = StrConv (EData. Text, vbUnicode)

If the trouble still exists please, inform us when and how exactly described mistake occurs and the version of your Visual Basic, operating system and DXF.dll.

Sergey

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

Daave
Posts: 4
Joined: 12 Apr 2005, 11:27
Location: France
Contact:

Post by Daave » 13 Apr 2005, 17:42

Ok by using StrConv, i can now see the .layer and .text (VB fully support my simple string in structures, but i'm out of subject)

Could you tell me about the other var i need to recover (label, text value and other values from attribute blocs ) ?

Thanks for caring.

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

Post by support » 13 Apr 2005, 22:49

Only three fields has to be converted. They are EData.Layer, EData.Text and EData.FontName.

Sergey

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

Daave
Posts: 4
Joined: 12 Apr 2005, 11:27
Location: France
Contact:

Post by Daave » 14 Apr 2005, 01:25

I'd like to know if the struc _DXFDATA will be change in the next version to add the ATTRIBUTE blocs fields like .label and .message and some the other fields concerned.

Here is the DXFDATE struct that is in my DXF.DLL :

typedef struct _DXFDATA {
WORD Tag;
WORD Count;
WORD TickCount;
BYTE Flags;
BYTE Style;
int Dimension;
LPDXFPOINT DashDots;
int DashDotsCount;
int Color;
LPVOID *Ticks;
float Thickness;
float Rotation;
char* Layer;
char* Text;
HANDLE Handle;
DXFPOINT Point1;
DXFPOINT Point2;
DXFPOINT Point3;
DXFPOINT Point4;
union {
struct {
float Radius;
float StartAngle;
float EndAngle;
float Ratio;
} Arc;
struct {
HANDLE Block;
DXFPOINT Scale;
} Blocks;
struct {
float FHeight;
float FScale;
float RWidth;
float RHeight;
BYTE HAlign;
BYTE VAlign;
} Text;
LPDXFPOINT *PolyPoints;
} DATA;
} DXFDATA, *LPDXFDATA;


Thanks a lot for helping me.

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

Post by support » 14 Apr 2005, 15:03

Could you please send to us the file that includes such entities as ".label and .message".
Official Autodesk DXF Reference does not describe them.
Sergey

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

Daave
Posts: 4
Joined: 12 Apr 2005, 11:27
Location: France
Contact:

Post by Daave » 15 Apr 2005, 17:02

I didn't know english names of those field and try to translate them from french.
After researches, it seemes that they 're named :
- Tag
- Prompt
- Default
- Value
- ...

I found infos at :
http://usa.autodesk.com/adsk/servlet/it ... ID=2475176

Are those elements can be recovered with your DXF.DLL ?
(There is already a Tag field in your struct, but as it is WORD, instead of STRING, i dont think it is the one i m looking for)

Li Yunbo
Posts: 5
Joined: 07 May 2005, 18:13

Post by Li Yunbo » 08 May 2005, 12:25

GlobalWidth is very useful to PLine, I suggest to add this field to DXFDATA.

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

Post by support » 19 May 2005, 12:15

Hi,

In the closest plans we are not going to change DXFDATA globally but we are working with the adding GlobalWidth for PLine to DXFDATA using its current opportunities.

Sergey.

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

Post Reply