rickh Posted July 5, 2012 Posted July 5, 2012 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 : Quote
rickh Posted July 5, 2012 Author Posted July 5, 2012 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] : Quote
JPlanera Posted July 5, 2012 Posted July 5, 2012 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. Quote
rickh Posted July 5, 2012 Author Posted July 5, 2012 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. Quote
jvillarreal Posted July 5, 2012 Posted July 5, 2012 JPlanera's suggestion is your best bet IMO. Here's a read for you: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Command-DwgUnits/td-p/1922109 and I've attached my area program as an example of how you could use insunits in your program. AC_AREA-CALC_v2.1_original.lsp Quote
Recommended Posts
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.