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

Metric and imperial

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
HelloWorlddd
705 Views, 5 Replies

Metric and imperial

My command is create for metric drawings, but sometimes it will execute in the imperial drawing, so I need to know if a drawing is a metric drawings or imperial drawing, and then set diferent value for differet drawings.

 

How do I know that relevant information, thanks for any help.


The below pricture show the two different drawing.

inchAndMetric.PNG

5 REPLIES 5
Message 2 of 6
mzakiralam
in reply to: HelloWorlddd

try to get the system variable DIMLUNIT. It will return a integer. on the basis of integer you will be able to get which kind is unit setting is there. Suppose if it returns 2 then unit is decimal. If returns 5 then setting is Architectural. Please see below screen shot for details

 

Capture1.JPG

Message 3 of 6
SENL1362
in reply to: HelloWorlddd

measurement=0 or 1(for metrics)
Message 4 of 6
HelloWorlddd
in reply to: mzakiralam

I meet some problem, I will get 2 when use the below statements:

 

 int DIMLUNIT = System.Convert.ToInt32(Application.GetSystemVariable("DIMLUNIT"));
Application.ShowAlertDialog(DIMLUNIT.ToString());


Then I change the Drawing Units from Decimal to Architectural, I will get 2 also, I don't know why.

I just want to get 2 when the Drawing Units is Decimal and get 4 when the  Drawing Units is Architectural,
How should I do?

Thanks

Message 5 of 6
mzakiralam
in reply to: HelloWorlddd

HI ,

sorry it was my mistake. "DIMLUNIT" is supposed to be used for dimension only. you have to use "LUNITS" in this case.

 

Capture3.JPG

Message 6 of 6
HelloWorlddd
in reply to: mzakiralam

Thank you very much

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