Page 1 of 1

DWG Unit is always "Unitless"

Posted: 09 Mar 2016, 13:17
by LIordanov
Hi,

I'm using CAD .NET 10.2 and to parse DWG files. I need to obtain the unit used. In AutoCAD the unit is set to Inches, however, after the file is loaded the DWGImage.Converter.HeadStruct.InsUnits property is set to Unitless. I saw the following post:

http://cadsofttools.com/forum/viewtopic ... nit#p12679

but it does not work in my case.

Thanks,
Latchezar

Re: DWG Unit is always "Unitless"

Posted: 09 Mar 2016, 15:58
by support
Hello Latchezar,

Could you check what value of a Block unit setting is displayed in a Block Definition dialog box when a DWG file is opened in AutoCAD? For example:

Image

Mikhail

Re: DWG Unit is always "Unitless"

Posted: 13 Mar 2016, 08:26
by LIordanov
Hi Mikhail,

Yes - all block units are set Inches. However, when I access the Converter.HeadStruct.InsUnits property of a particular block the value is set to "Unitless". In addition the "Converter" instance is the same for all blocks and the drawing itself even though each block can have a different unit.

The AutoCAD version used is 2013.

Thanks,
Latchezar

Re: DWG Unit is always "Unitless"

Posted: 15 Mar 2016, 15:23
by support
Hello Latchezar,
In addition the "Converter" instance is the same for all blocks and the drawing itself even though each block can have a different unit.
CADBlock.Converter contains a reference to CADImage.Converter which is the same for all objects in a drawing, so each block will have units specified by a CADImage.Converter.HeadStruct.InsUnits property. Actually, the CADImage.Converter.HeadStruct.InsUnits contains a value of INSUNITS variable that is saved in the drawing file. You may try to save a DWG file to the DXF format, open the DXF file in Notepad and search for $INSUNITS entry. INSUNITS variable value goes after a 70 group code.


Mikhail