Page 1 of 1

CAD importer SDK DLL VB

Posted: 12 Apr 2005, 11:36
by Daave
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 ?

Posted: 13 Apr 2005, 15:40
by support
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

Posted: 13 Apr 2005, 17:42
by Daave
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.

Posted: 13 Apr 2005, 22:49
by support
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

Posted: 14 Apr 2005, 01:25
by Daave
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.

Posted: 14 Apr 2005, 15:03
by support
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

Posted: 15 Apr 2005, 17:02
by Daave
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)

Posted: 08 May 2005, 12:25
by Li Yunbo
GlobalWidth is very useful to PLine, I suggest to add this field to DXFDATA.

Posted: 19 May 2005, 12:15
by support
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