DWG Unit is always "Unitless"

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
LIordanov
Posts: 2
Joined: 09 Mar 2016, 13:06

DWG Unit is always "Unitless"

Post by LIordanov » 09 Mar 2016, 13:17

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

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

Re: DWG Unit is always "Unitless"

Post by support » 09 Mar 2016, 15:58

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

LIordanov
Posts: 2
Joined: 09 Mar 2016, 13:06

Re: DWG Unit is always "Unitless"

Post by LIordanov » 13 Mar 2016, 08:26

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

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

Re: DWG Unit is always "Unitless"

Post by support » 15 Mar 2016, 15:23

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply