.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unitless Block Insertion

1 REPLY 1
Reply
Message 1 of 2
PSharpe
640 Views, 1 Reply

Unitless Block Insertion

HI All,

If you insert a Unitless block into a drawing with the units set to mm or inches via the interface, AutoCAD will automatically take care of the scaling for you. By looking at the properties of a Unitless block after insertion it appears as though all CAD is doing is scaling the block in accordance with the units in the drawing.

 

Does anyone know how CAD is doing this calculation and how to get the same effect using the .NET API at the time of insertion?

 

I could setup a function that examines the units of the block being inserted and the units of the drawing the block is being inserted into but how would i be sure i'm using the same conversion value as CAD?

 

e.g. I might decide 1 Unit = 0.0393 when i do the insert, whereas CAD might use 1 Unit = 0.03937007.

 

It would be nice to either use the same value or a function that the API provides that i'm not aware of to do the conversion

Any help would be great.

Thanks

1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: PSharpe

Hi,

 

Sorry for the delay. 

 

Have you tried using the "UnitsConverter.GetConversionFactor" which is the .Net API equivalent of "acedGetUnitsConversion" ?

 

This provides a conversion factor if you know the "from" and "to" units.

 

Regards,



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost