1
AutoLISP (Vanilla / Visual) / Re: Need help "rotate block for preview prior pick point to insert block"
« Last post by Phuc Le on Today at 09:45:23 PM »Thank you Marko Ribar !
The command is -DWGUNITS and not INSUNITS or LUNITS.
Please pay more attention before responding.
How to do it without COMMAND to look elegant within a program?
How to modify the value in -DWGUNITS from 3 to 6 by AutoLISP?
Command: -DWGUNITS
Drawing units:
1. Inches
2. Feet
3. Millimeters
4. Centimeters
5. Decimeters
6. Meters
Unit for length <3>: 6
Something like thisCode: [Select](command "-dwgunits" 6 2 3 "N" "Y")
With my ancient A2K, this works: (setvar "LUNITS" 2) <- for decimal
Untested but?Code: [Select](defun check-and-set-lunits ()
(if (/= (getvar "LUNITS") 6) ; Check if LUNITS is not already set to 6
(progn
(setq change_units (strcat "\nLUNITS is currently set to " (itoa (getvar "LUNITS")) ", do you want to change it to 6? [Y/N]: "))
(if (equal (getstring change_units) "Y")
(setvar "LUNITS" 6) ; Change LUNITS to 6
(prompt "\nLUNITS remains unchanged.")))))
(check-and-set-lunits)
Change for meters