Jump to content

Recommended Posts

Posted

Hi all,

I am writing a little routine to output acres, sf, sy, etc... so I would like to check the drawing units of length to ensure they are set to Feet.

 

I know if I type "-dwgunits" (or "-aecdwgunits" in c3d) the first item is what I'm looking for, shown below.

 

Can anyone point me in the right direction to check this value from inside lisp? Many Thanks!:)

 

Drawing units:

1. Inches

2. Feet

3. Millimeters

4. Centimeters

5. Decimeters

6. Meters

Unit for length :

Posted

Try this

 

(setq DU (getvar "insunits"))

Posted

Thanks for the reply, but the insunits are not the same as the units for length...running through the "-aecdwgunits" command, the last setting asks if you want to match the two:

 

Match INSUNITS to drawing units? [Yes/No] :

Posted

Match INSUNITS should always be YES. Otherwise a block drawn in INCHES will convert to MILLIMETERS when inserted... why would you want that? Change that to YES and the above code will work... Unless there is a reason why you need to have the insertion units different to the drawing units... doesnt make sense to me.

Posted

Sorry....I agree - insunits should match (although sometimes unitless is preferred.)....

 

But it's besides the point. I am trying to check the drawings unit of length (getvar ???) if possible. My point is that checking the insunits is no guarantee that the length units are the same.

 

An example where this can be a problem in Civil 3d is when someone gets an acad file from an architect (for example) that doesn't have civil 3d. The drawing units in civil 3d (settings tab) do not allow anything but feet or meters. However, the original file in these instances was not created with civil 3d so the units for length might be "inches". As for Insunits, they might be anything from an outside client....but for my purposes it doesn't matter. In these files, once you select feet or meters, and go back to the settings tab to set units, you will see "inches" is no longer a valid selection. This is a problem for users that don't understand everything that's going on. I just want to prevent the faulty output without assuming they know what they're doing.

 

I hope this doesn't read in a negative attitude or anything....just trying to explain my reasoning. I want to send them a no-no message if their units of length are not set to feet.....maybe I can add a message if they're insunits don't match also....:)

 

Thanks.

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...