View Full Version : Script to change drawing UNITS
gsteel
16th May 2011, 03:30 pm
I am trying to creat a script....
I'm sure it is easy but to my novice brain I can't get it to work.
I simply want to change a drawings units to millimeters and not rescale anything.
I have tried -units but it doesn't give the option to change the actuall Drawing Units:
Any help would be appreciated
Cheers
Greg
SLW210
16th May 2011, 04:35 pm
I have renamed and relocated your thread to a better location for related responses.
Try checking "Similar Threads" at the bottom of this page.
All you do when creating a script is invoke a command on the command line and answer the prompts. Where are you hanging up?
Command: -units
Report formats: (Examples)
1. Scientific 1.55E+01
2. Decimal 15.50
3. Engineering 1'-3.50"
4. Architectural 1'-3 1/2"
5. Fractional 15 1/2
With the exception of Engineering and Architectural formats,
these formats can be used with any basic unit of measurement.
For example, Decimal mode is perfect for metric units as well
as decimal English units.
Enter choice, 1 to 5 <4>:
Enter denominator of smallest fraction to display
(1, 2, 4, 8, 16, 32, 64, 128, or 256) <32>:
Systems of angle measure: (Examples)
1. Decimal degrees 45.0000
2. Degrees/minutes/seconds 45d0'0"
3. Grads 50.0000g
4. Radians 0.7854r
5. Surveyor's units N 45d0'0" E
Enter choice, 1 to 5 <1>:
Enter number of fractional places for display of angles (0 to 8) <2>:
Direction for angle 0.00:
East 3 o'clock = 0.00
North 12 o'clock = 90.00
West 9 o'clock = 180.00
South 6 o'clock = 270.00
Enter direction for angle 0.00 <0.00>:
Measure angles clockwise? [Yes/No] <N>
Maybe you are wanting to change your Dimensions instead?
If you want to change the physical drawing from one that is 1 = 1 inch, 1 = 1 foot, 1 = 1mm, 1 = 1cm, 1 = 1m to another then rescaling the drawing is your only option.
sparkyuk
16th May 2011, 04:40 pm
If you have drawn in model space at 1-1 then its should only be a matter of selecting the correct scale when printing or saving your drawing shouldnt it ?
gsteel
16th May 2011, 04:42 pm
Hi thanks for your reply.
I have hundreds of drawings I have received. Many of them have the units set to inches, so I have to type UNITS and set it to millimeters, I am hoping to create a script to automate this process as well as setting a few other pararmeter but I can't get the units bit to work.
-units does not let me change the 'Drawing Units'
SLW210
16th May 2011, 08:13 pm
Hi thanks for your reply.
I have hundreds of drawings I have received. Many of them have the units set to inches, so I have to type UNITS and set it to millimeters, I am hoping to create a script to automate this process as well as setting a few other pararmeter but I can't get the units bit to work.
-units does not let me change the 'Drawing Units'
Yes it does. You just do not understand what drawing units "ARE" and "ARE NOT".
I have renamed and relocated your thread to a better location for related responses.
Try checking "Similar Threads" at the bottom of this page.
All you do when creating a script is invoke a command on the command line and answer the prompts. Where are you hanging up?
Command: -units
Report formats: (Examples)
1. Scientific 1.55E+01
2. Decimal 15.50
3. Engineering 1'-3.50"
4. Architectural 1'-3 1/2"
5. Fractional 15 1/2
With the exception of Engineering and Architectural formats,
these formats can be used with any basic unit of measurement.
For example, Decimal mode is perfect for metric units as well
as decimal English units.
Enter choice, 1 to 5 <4>:
Enter denominator of smallest fraction to display
(1, 2, 4, 8, 16, 32, 64, 128, or 256) <32>:
Systems of angle measure: (Examples)
1. Decimal degrees 45.0000
2. Degrees/minutes/seconds 45d0'0"
3. Grads 50.0000g
4. Radians 0.7854r
5. Surveyor's units N 45d0'0" E
Enter choice, 1 to 5 <1>:
Enter number of fractional places for display of angles (0 to 8) <2>:
Direction for angle 0.00:
East 3 o'clock = 0.00
North 12 o'clock = 90.00
West 9 o'clock = 180.00
South 6 o'clock = 270.00
Enter direction for angle 0.00 <0.00>:
Measure angles clockwise? [Yes/No] <N>
Maybe you are wanting to change your Dimensions instead?
If you want to change the physical drawing from one that is 1 = 1 inch, 1 = 1 foot, 1 = 1mm, 1 = 1cm, 1 = 1m to another then rescaling the drawing is your only option.
http://help.autodesk.com/kb/display.do?ROW_ID=1-GQC-870
I have in my current drawing a building that is 60'-0" (as dimensioned) or "as drawn" it is 720 DRAWING UNITS because I drew with 1 DRAWING UNIT to equal 1 INCH (60 x 12 = 720). Unless I rescale it the actual drawing will always be 720 DRAWING UNITS.
Jack_O'neill
17th May 2011, 06:02 am
Perhaps we are suffering from a terminology problem. Gsteel, are you simply wishing to convert a drawing done in inches to millimeters? In other words, if you have a dimension that says 1" you want it to say 25.4mm, right? There are a couple of ways to do this. One is to go to the format menu, down to dimension style. Then pick one and click modify. Click on the tab that says "alternate units". Once that is done, look for "display alternate units" and put a check in the box. hit ok, then "set current" and "close". Any dimensions on your drawing using that dimension style will then display the imperial and the metric numbers.
If you want only the metrics, instead of clicking on the "alternate units" tab, click on "primary units". Down near the middle of the dialog box you'll see "measurement scale" with a box that says "scale factor". Enter 25.4 there and your dims will be in millimeters instead of inches.
dbroada
17th May 2011, 07:03 am
from a similar thread the other day didn't somebody say ACAD Arch was different from vanilla for this sort of problem?
gsteel
17th May 2011, 09:58 am
Ok maybe I am being a bit thick here..... :?
I have drawing all drawn at 1:1 scale in model space. Under the UNITS command they are all set to inches and I want them as mm. I can do it manuallt by typing UNITS and selecting mm from the first drop down (Drawing Units). It then asks me if I want to rescale the drawing and I say no. I have hundred of these to do I was simply hoping there was a script that would perform this automated. I am using Architecture 2011 if that is relevant.
@SLW210 - I am quite sure I am aware what a unit is thanks for the info tho.
@Jack - Our dimension come out in mm, I have a script that sets up my dims for me. thanks tho
@dbroada - I'm not sure what Vanilla is? In Autocad terms anyway :)
SLW210
17th May 2011, 12:52 pm
It is your option to refuse all the sound advise given you here, I hope you get this figured out.
In case you want to know, the answer you seek is in my original response to your question.
If you desire to be rude, then I will help you no further.
gsteel
17th May 2011, 12:56 pm
I have in no way been rude to any one please post my previous reply as proof!
In have indeen been through you first post as I have been though the help files I tried all variations and options non of which change the setting required.
gsteel
17th May 2011, 01:21 pm
I have attached a screen shot of the setting I need to change. inches to millimeters 27630
It isn't that the dimensions are coming in in inches I can get them in mm fine (As I have stated in my mysteriously removed post)
SEANT
17th May 2011, 01:22 pm
In the command line it would look like this:
Command: INSUNITS
Enter new value for INSUNITS <1>: 4
gsteel
17th May 2011, 01:36 pm
Hi thanks SEANT. That doesn't seem to work tho. It runs fine but doent change inches to millimeters.
SEANT
17th May 2011, 01:58 pm
I’m not sure if Architecture 2011 goes about it differently, certainly the dialog boxes show some variation, but the command sequence below produces the changes illustrated in the images for plain AutoCAD.
Command: LUNITS
Enter new value for LUNITS <4>: 2
Command: INSUNITS
Enter new value for INSUNITS <1>: 4
gsteel
17th May 2011, 02:10 pm
Do you see the same dialogue as I posted when you type units?
SEANT
17th May 2011, 02:20 pm
No. I see the one I attached above.
gsteel
17th May 2011, 02:23 pm
Sorry I can't see your attachment :(
SEANT
17th May 2011, 02:48 pm
Sorry I can't see your attachment :( Thats odd. The image shows a before and after shot of the UNITS dialog box for AutoCAD. The box differs from the one you show for Architecture 2011, but not by much. Those two system variables are those used to change the Unit Type (Decimal, Engineering, etc.) and the "Units to scale inserted content: " (Millimeters, Inches, etc.)
gsteel
17th May 2011, 02:58 pm
I have gone through all the settings in the options and one found one glaring mistake... I have my profile set to US. metric...... I have changed it to UK metric and all seems as I need it.. all the properties etc are now showing in mm.
Sorry for wasting time but the process has got me there. Thanks for everyones help (even SLW210 :wink:)
Jack_O'neill
17th May 2011, 03:06 pm
Seant...I can't see your image either. See below:
27641
SEANT
18th May 2011, 12:51 am
I'm not sure why that image is not showing. I see it on the computer I used to make the post, but not my other computer. I made the post via Internet Explorer 9; that version of IE has problems with the Autodesk Discussion software as well. Perhaps the problem is related.
BIGAL
18th May 2011, 09:40 am
This may be usefull
(defun civ_units ()
(SETQ ANGBASEE (GETVAR "ANGBASE"))
(SETQ ANGDIRR (GETVAR "ANGDIR"))
(SETQ LUNITSS (GETVAR "LUNITS"))
(SETQ LUPRECC (GETVAR "LUPREC"))
(SETQ AUNITSS (GETVAR "AUNITS"))
(SETQ AUPRECC (GETVAR "AUPREC"))
(SETVAR "LUNITS" 2)
(SETVAR "ANGBASE" 0.0)
(SETVAR "ANGDIR" 0)
(SETVAR "LUPREC" 0)
(SETVAR "AUNITS" 0)
(SETVAR "AUPREC" 0)
)
(defun old_civ_units ()
(SETVAR "LUNITS" lunitss)
(SETVAR "ANGBASE" angbasee)
(SETVAR "ANGDIR" angdirr)
(SETVAR "LUPREC" luprecc)
(SETVAR "AUNITS" aunitss)
(SETVAR "AUPREC" auprecc)
)
ahyin
30th May 2011, 10:42 am
I have gone through all the settings in the options and one found one glaring mistake... I have my profile set to US. metric...... I have changed it to UK metric and all seems as I need it.. all the properties etc are now showing in mm.
Sorry for wasting time but the process has got me there. Thanks for everyones help (even SLW210 :wink:)
I got the same problem as you, can you tell me how to solve this problem ?
gsteel
30th May 2011, 10:55 am
In the options, profile tab, I created a new profile.
I set my units to mm. and then quit.
Then what you have to do to assign your profile when you start Autocad is alter the properties in your Autocad shortcut. here is how my shortcut target now reads....
"C:\Program Files\Autodesk\AutoCAD Architecture 2011\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD Architecture 2011\AecBase.dbx" /p "Gregs Acad Profile"
with "Gregs Acad Profile" as the name of the new profile created.
There may be a better way to do this but it worked for me.. Hope it helps
ahyin
31st May 2011, 03:04 am
In the options, profile tab, I created a new profile.
I set my units to mm. and then quit.
Then what you have to do to assign your profile when you start Autocad is alter the properties in your Autocad shortcut. here is how my shortcut target now reads....
"C:\Program Files\Autodesk\AutoCAD Architecture 2011\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD Architecture 2011\AecBase.dbx" /p "Gregs Acad Profile"
with "Gregs Acad Profile" as the name of the new profile created.
There may be a better way to do this but it worked for me.. Hope it helps
Thank you very much for your suggestion gsteel ! I try to use this method open the files but not successful. The CAD file units still in inches. As you said, you changed the pofile to UK to solve his problem, is it necessary to install something ? Because during the installation process, I uncheck the unit "inches". Do you think it will affect this ?
gsteel
31st May 2011, 01:04 pm
During the installation settings there is an option to include UK content pack which we install. I guess you might need this in order to use my method. I'm not sure if you can add this after installation of if you need to do a clean install.
In our profile options we have - AutoCAD, AutoCAD Architecture (UK), AutoCAD Architecture(US Metric), and my own profile now.
ahyin
1st Jun 2011, 02:55 am
During the installation settings there is an option to include UK content pack which we install. I guess you might need this in order to use my method. I'm not sure if you can add this after installation of if you need to do a clean install.
In our profile options we have - AutoCAD, AutoCAD Architecture (UK), AutoCAD Architecture(US Metric), and my own profile now.
Thank so much for your help !
lyngo
9th Feb 2012, 11:41 am
Does this work with autocad 2011 MAC?
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.