Jump to content

inputting MM from the command line in a architectural units drawing


albroswift

Recommended Posts

Hello, searched these keywords but seems like most answers involve scaling the drawing, so, specifically, I have a drawing that is in Architectural feet and inches. Most of the dimensions I am entering are in inches / feet/ inches, but some components I get the measurements in MM that I want to draw. I have the alt units on and set to 25.4 so drawing shows both types of dims, which is cool, but I would also like to be able to enter offsets, stretches, etc in MM as needed instead of having to convert MM to inches every time.

Thanks in advance

AL

Link to comment
Share on other sites

I'm sure someone will have or suggest a LISP to make this easy, but here is my input, a simple macro that lets you draw a line and it automatically scales it from mm to inch, not ideal but it saves getting the calculator out, and you can use the line as a basis for offset and scale references etc.

^C^C^Cl;\\;sc;l;;$M=$(getvar,lastpoint);.03937;

Link to comment
Share on other sites

Thanks, JD

'cal cvunit(254,mm,in) 10 works as expected and solves my problem but time consuming, could you or someone show me how to automate as a lisp or macro?

Thanks--

AL

Link to comment
Share on other sites

Lisp code can be found here http://www.ellenfinkelstein.com/acadblog/switch-between-imperial-and-metric-measurements/

 

However, I think it would be more efficient to create the objects in the native units and then rescale... or draw the metric components in different metric drawing and then bring them into the main drawing (possibly as blocks or xrefs)

Link to comment
Share on other sites

Unexpected behavior CVunit

I have a square dynamic block 1'X1' with stretch parameters

When I activate a stretch grip and enter for example 10, the block stretches (shrinks) to 10" in as expected.

But

When I activate a stretch grip and enter for example 'cal cvunits(254,mm,in) the block stretches to 1' 10", not 10" as expected. Using the 'cal expression appears to add to existing length, while simply entering the length results in the block stretching (shrinking) to that length. Something simple I am missing?

Trying to upload file but the little spinner keeps a spinnin' and a spinnin' and it's only a 64K file

Link to comment
Share on other sites

Lisp code can be found here http://www.ellenfinkelstein.com/acadblog/switch-between-imperial-and-metric-measurements/

 

However, I think it would be more efficient to create the objects in the native units and then rescale... or draw the metric components in different metric drawing and then bring them into the main drawing (possibly as blocks or xrefs)

I gave Ellen's lisps a try but I don't think I can enter them in a stretch command, and my lisp skills are not to the point I could modify them.

By the time I start working in different drawings with different units to accomplish what specifically I am trying to do I might as well just use a calculator and pencil.

Easiest way I've found so far is insert block, stretch using native units and then scale> 'cal 10/254 . The 'cal works directly in stretch grips but behaves differently then entering unit directly in stretch. I have looked at a bunch of other threads on this and other forums seems like there is just not an "easy button"...

Thanks for all the tips, stretched the brain out a little and sure to be used elsewhere.

Link to comment
Share on other sites

.... seems like there is just not an "easy button"...

 

In the CAD programs I use (not AutoCAD) I simply enter the units I need at any time and the software takes care of conversion for me.

So maybe the Easy Button is to change software. :lol:

Link to comment
Share on other sites

Uploaded the block I was talking about in earlier post.

Activate a grip, type "10", block RESIZES TO 10". Activate a grip, type 'cal cvunits (254,mm,in) or 'cal 254/25.4 block INCREASES BY 10"

Is there a setting I am missing for the 'cal command that affects this behavior?

If you have time please check it out for me, really curious.

Thanks--

Al

CV_Drawing2 - Copy.zip

Link to comment
Share on other sites

be careful when converting mm to inches, .03937 is ok for most things, but when it comes to tight tolerances it is not, use 25.4 or 0.0393700787401575

 

a person I know at a large engineering company found this out the hard way

 

they were designing parts here in the USA to be fabricated in England, so they converted the drawings to metric, the parts always came back slightly out of spec. after several phone calls, calibrations, confirmation of said calibrations, manufacturing and shipping environment studies, the answer turned out to be simple.

 

The shop in England was using “inches” type measuring tools, in hopes of holding the best possible part for the USA customer’s and converting the prints back to inches using .03937

 

.0000000787401575 seems small, but can cost you in the end.

 

I think you would be better off changing the units to mm.

Link to comment
Share on other sites

I always use the 1/25.4 or 10/254 rather then the .03937, although what I am doing either one works fine. Wasn't there a time when 1" did not exactly equal 25.4 MM? Seems to me in ancient history the powers that be said "close enough" dropping some decimal accuracy.

Edit: checked, before 1959 an inch was 25.4000508 mm!

Edited by albroswift
Link to comment
Share on other sites

Sweet! The easy button I was looking for. Thanks, MDB!

Al

Edit: in a grip dialogue box it adds to the current length, same as 'cal. when directly inputting a number in grip dialogue box it replaces the current length, which is what I am aiming for. When I am referring to grips, I am talking about the stretch parameter of a dynamic block. Regular grips on an entity always seem add whether 'cal, ,mm, or directly inputting distance

Edited by albroswift
Link to comment
Share on other sites

for those who can't run lisp here is a macro for drawing lines in mm while in inch units.

 

^C^C^C_line;\(cvunit;\;"inches""millimeter")

 

use at own risk, not tested in LT

Edited by zaphod
Link to comment
Share on other sites

Try this two, transparent routines:

 

Just dropped by to thank mdbdesign for these two lisps.

 

So pleased I found them.

 

Cheers.

Link to comment
Share on other sites

Try this two, transparent routines:

 

Just noticed. When I first open an AutoCAD drawing, the two lisps work fine. If I then open another drawing I get the following error message: -

 

error: Visual LISP command document mismatch: inch

 

or

 

error: Visual LISP command document mismatch: mm

 

I am using AutoCAD 2009 and I always use SDI mode set at 1.

Maybe it's because of my SDI setting?

Link to comment
Share on other sites

Sorry, I forgot to mention about when I post codes.

Hope somebody will fix it so it work on all open drawings.

I don't know who is author of it.

Link to comment
Share on other sites

Sorry, I forgot to mention about when I post codes.

Hope somebody will fix it so it work on all open drawings.

I don't know who is author of it.

 

mdbdesign, thanks for replying.

 

I did a bit of google searching and found a pair of alternative lisp files that do the same thing and it appears they can work if more than one drawing is open.

Again they are invoked like a transparent command.

I stated the source and credited the authors at the top of the lisp files.

 

Inch2mm-imm.lsp

Type 'imm to invoke or make a toolbutton with macro _'imm

 

mm2inch-mmi.lsp

Type 'mmi to invoke or make a toolbutton with macro _'mmi

 

Hope others can find these useful.

Inch2mm-imm.lsp

mm2inch-mmi.lsp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...