1
AutoLISP (Vanilla / Visual) / Re: Modify DWGUNITS
« Last post by FELIX on May 17, 2024, 11:46:23 PM »Something like thisCode: [Select](command "-dwgunits" 6 2 3 "N" "Y")
How to do it without COMMAND to look elegant within a program?
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
(defun laytest (/ LAYLIST TBLAYOUT)
(setq LAYLIST (list "A" "B" "C" "D" "E" "F" "G"))
(setq TBLAYOUT "TEMPLATE")
(foreach MAP laylist (command "LAYOUT" "C" TBLAYOUT MAP))
)