Dwg units

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

Moderators: support, SDS, admin

Post Reply
FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Dwg units

Post by FieldConsult » 19 May 2015, 01:00

how can we know which unit is a DWG file we want to load?

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

Re: Dwg units

Post by support » 21 May 2015, 18:09

Hello,

The drawing units value is stored in the INSUNITS variable of a DWG/DXF file. In CAD VCL, you can read this value using TsgHeadVarStruct.InsUnits field:

Code: Select all

case Img.Converter.HeadVarStruct.InsUnits of
   0: StatusBar1.Panels[0].Text := 'Drawing units: Unitless';
   1: StatusBar1.Panels[0].Text := 'Drawing units: Inches';
   4: StatusBar1.Panels[0].Text := 'Drawing units: Millimeters';
end;
For more information about INSUNITS variable values in AutoCAD, refer to the following article:
http://knowledge.autodesk.com/support/a ... 8-htm.html


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: Dwg units

Post by FieldConsult » 21 May 2015, 19:15

Thanks!

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: Dwg units

Post by FieldConsult » 15 May 2016, 21:17

Img.Converter.HeadVarStruct.InsUnits allways is 0.

I have tried 20 different files (in milimeters, meters, etc) and each file was reported as "Unitless '.
The reporting code is on the Mouse Move event.

Why?

P.D.: I look on GetPHeadVarStruct procedure, on first read (open the file) the InsUnits value is correct but, later this is changed!!

Why?

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

Re: Dwg units

Post by support » 16 May 2016, 15:11

Hello,

This is an issue that must be fixed. Note that this issue concerns only the DWG files, if you'll try to read INSUNITS value from a DXF file, TsgHeadVarStruct.InsUnits will return a correct value.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: Dwg units

Post by FieldConsult » 16 May 2016, 17:36

I work with many DWG files, I need this fixed as soon as possible.

Thanks!!

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: Dwg units

Post by FieldConsult » 21 May 2016, 01:14

Again, what happens with your support, there is a serious problem and you do not comment on how and when it will be resolved or perhaps think that we should expect to pay for the license "number 20" to have the problem solved.

I need this solution now!!!!!!!

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

Re: Dwg units

Post by support » 24 May 2016, 20:35

Hello,

We've opened a case for this issue, but currently I can't tell when it will be resolved.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: Dwg units

Post by FieldConsult » 25 May 2016, 19:25

Perhaps this can help:
What you need to read is a Flag data, before Insunits variable:
You have the handle:

DICTIONARY_LAYOUTS := R.H;
DICTIONARY_PLOTSETTINGS := R.H;
DICTIONARY_PLOTSTYLES := R.H;

and the flags:
Flags := R.BL;
CELWEIGHT := (Flags AND $001F);
ENDCAPS := (Flags AND $0060) shr 5;
JOINSTYLE := (Flags AND $0180) shr 7;
WDISPLAY := (Flags AND $0200) = 0;
XEDIT := (Flags AND $0400) = 0;
EXTNAMES := (Flags AND $0800) > 0;
PSTYLEMODE := (Flags AND $2000) > 0;
OLESTARTUP := (Flags AND $4000) > 0;

later the value we need so much:

INSUNITS := R.BS;

I hope that helps.

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

Re: Dwg units

Post by support » 25 May 2016, 21:22

Hello,

Thank you for the information.

Please take into account that we plan to solve this issue in version 11 which is the latest one, because we provide free support within one major version and all the fixes are usually added to the current release.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: Dwg units

Post by FieldConsult » 25 May 2016, 21:38

At the same time you should remember that if you sell a defective product, under the license terms, you are obliged to repair the errors, at no cost, as the license has been paid. The problem does not refer to a new feature or new implementation, it refers to an error in the original code (paid), which legally is not subject to payment of a new license, but rather to repair by the seller of the product.

Each time a source code error are repaired, a repair must be implemented for the affected versions and not just for the new version.

Remember that in the past (more than a year ago), I have indicated several errors in your source code, which have never been solved, affecting the basis of the license agreement.

Post Reply