Page 1 of 1

Dwg units

Posted: 19 May 2015, 01:00
by FieldConsult
how can we know which unit is a DWG file we want to load?

Re: Dwg units

Posted: 21 May 2015, 18:09
by support
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

Re: Dwg units

Posted: 21 May 2015, 19:15
by FieldConsult
Thanks!

Re: Dwg units

Posted: 15 May 2016, 21:17
by FieldConsult
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?

Re: Dwg units

Posted: 16 May 2016, 15:11
by support
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

Re: Dwg units

Posted: 16 May 2016, 17:36
by FieldConsult
I work with many DWG files, I need this fixed as soon as possible.

Thanks!!

Re: Dwg units

Posted: 21 May 2016, 01:14
by FieldConsult
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!!!!!!!

Re: Dwg units

Posted: 24 May 2016, 20:35
by support
Hello,

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


Mikhail

Re: Dwg units

Posted: 25 May 2016, 19:25
by FieldConsult
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.

Re: Dwg units

Posted: 25 May 2016, 21:22
by support
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

Re: Dwg units

Posted: 25 May 2016, 21:38
by FieldConsult
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.