.NET

Reply
Valued Contributor
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 1 of 6 (205 Views)
Accepted Solution

Metric and imperial

205 Views, 5 Replies
04-01-2014 05:30 AM

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

measurement=0 or 1(for metrics)

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

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 6 (199 Views)

Re: Metric and imperial

04-01-2014 05:45 AM 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

Mentor
SENL1362
Posts: 212
Registered: ‎07-20-2011
Message 3 of 6 (171 Views)

Re: Metric and imperial

04-01-2014 12:07 PM in reply to: HelloWorlddd
measurement=0 or 1(for metrics)
Valued Contributor
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 4 of 6 (145 Views)

Re: Metric and imperial

04-02-2014 05:21 AM 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

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 5 of 6 (143 Views)

Re: Metric and imperial

04-02-2014 06:09 AM 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

Valued Contributor
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 6 of 6 (138 Views)

Re: Metric and imperial

04-02-2014 07:32 AM in reply to: mzakiralam

Thank you very much

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!