Recent Posts

Pages: [1] 2 3 ... 10
2
I mod. CAB's version in spare time...
I added GrSnap and few other options - calling OSNAP command during dragging...

Here is the link : https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/need-help-to-modify-code-quot-rotate-block-for-preview-prior/m-p/12782519/highlight/true#M466237
3
AutoLISP (Vanilla / Visual) / Re: Modify DWGUNITS
« Last post by FELIX on May 18, 2024, 09:13:17 PM »
The command is -DWGUNITS and not INSUNITS or LUNITS.

Please pay more attention before responding.
4
AutoLISP (Vanilla / Visual) / Re: Modify DWGUNITS
« Last post by JasonB on May 18, 2024, 04:58:21 PM »
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

This part of the command relates to INSUNITS
https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-A58A87BB-482B-4042-A00A-EEF55A2B4FD8
Code - Auto/Visual Lisp: [Select]
  1. (setvar 'INSUNITS 6)

PKENEWELL has listed this and the other system variables related to this command.

5
AutoLISP (Vanilla / Visual) / Re: Modify DWGUNITS
« Last post by FELIX on May 17, 2024, 11:46:23 PM »
Something like this

Code: [Select]
(command "-dwgunits" 6 2 3 "N" "Y")

How to do it without COMMAND to look elegant within a program?
6
AutoLISP (Vanilla / Visual) / Re: Modify DWGUNITS
« Last post by FELIX on May 17, 2024, 11:44:21 PM »
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

The command is -DWGUNITS and LUNITS does not accept =6
7
I found Lee Mac's code at this link:
https://www.theswamp.org/index.php?topic=40686.0
but I can't execute the block rotation function when pressing the ESC key (when I press ESC it exits the command)
Can someone please help me if possible: Change the block rotation function to the R key
8
AutoLISP (Vanilla / Visual) / Re: broke (Lee Macs) ScriptWriterV1-2.lsp
« Last post by Lee Mac on May 17, 2024, 06:29:01 PM »
You're more than welcome Lonnie - I'm delighted that it's still proving useful!  :-)
9
AutoLISP (Vanilla / Visual) / Re: Issue with Layout - Copy Command
« Last post by jnelson on May 17, 2024, 02:00:31 PM »
Thank you for testing on another version of AutoCAD.  I get the same results as you with ACAD2019, but not ACAD2024.
10
AutoLISP (Vanilla / Visual) / Re: Issue with Layout - Copy Command
« Last post by ribarm on May 17, 2024, 10:55:15 AM »
I deleted all Layouts and left Model and Layout1 as CAD could not remove Layout1, then I renamed it to "TEMPLATE" and then I run your sub routine...
I am using AutoCAD 2022 and I got this results shown in picture...
Pages: [1] 2 3 ... 10