Author Topic: Switch Between Fractional & Architectural units  (Read 1355 times)

0 Members and 1 Guest are viewing this topic.

Pukenzz

  • Newt
  • Posts: 48
Switch Between Fractional & Architectural units
« on: May 08, 2018, 02:44:31 PM »
99% of my drawing is done in Fractional Units.  From time to time I want to view / verify a snapped dimension in Architecture (Feet Inches) does anybody have a quick easy macro or lips that they could share that I can put on a button to toggle from Fraction to Feet Inches, and then I'd be looking for one to toggle back.

Thanks in advance

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Switch Between Fractional & Architectural units
« Reply #1 on: May 08, 2018, 02:54:16 PM »
Look up LUNITS and Setvar
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Switch Between Fractional & Architectural units
« Reply #2 on: May 08, 2018, 04:03:32 PM »
Something like this?
Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ d)
  2.   (if (setq d (getdist "\nPick your distance: "))
  3.     (alert (strcat (rtos d 2 3) "\n" (rtos d 3 3)))
  4.   )
  5.   (princ)
  6. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

PKENEWELL

  • Bull Frog
  • Posts: 320
Re: Switch Between Fractional & Architectural units
« Reply #3 on: May 10, 2018, 05:02:14 PM »
Simple Lisp or Macro to change the units of a Dimension:

Code - Auto/Visual Lisp: [Select]
  1. (command "_dimoverride" "_dimlunit" "4" "" pause "") ; Set to Architectural
  2.  
  3. (command "_dimoverride" "_dimlunit" "5" "" pause "") ; Set to Fractional
  4.  

"1" is Scientific, "2" is Decimal, "3" is Engineering, "4" is Architectural, "5" is Fractional, "6" is Follow Windows Format.

If you want to select more than one dimension at a time, you'll have to use (ssget) in place of where the [pause] is in the command.
"When you are asked if you can do a job, tell 'em, 'Certainly I can!' Then get busy and find out how to do it." - Theodore Roosevelt