Page 1 of 1

Am I going MAD?? or have I just forgotten??

Posted: Fri Feb 16, 2024 8:52 am
by sln8458
Ok, so I'm now running 12.1 PE+

Part of a lisp file I am working on is intended to rotate a rectangle by 90deg about the 'Y' axis.
Sound simple enough.
Here is the code, ENT_L1 is the object & 'rxl' is 225, with 'ag_l' being 90deg

Code: Select all

	(command "_Rotate3D" ENT_L1 "" (strcat (rtos rxl) ",0,0") (strcat (rtos rxl) ",500,0") ag_l "")
.

The result was not as I expected!
OK, so I'll draw a line to represent the rotation axis:

Code: Select all

	(command "_Line" (strcat (rtos rxl) ",0,0") (strcat (rtos rxl) ",500,0") "")
and this is the result:
line.png
line.png (30.24 KiB) Viewed 10497 times
Now I haven't use the '@' symbol so ALL dimensions/coordinates are 'absolute' not 'relative'.
So why does the line state at @0,0,0?

Command line:
Command: _Line
ENTER to use last point/[Follow]/<Start of line>: 225,0,0
[Angle/Length]/<End point>: 225,500,0
[Angle/Length/Follow/Undo]/<End point>:
rxl = 225
Command: '_PMTHIST

Re: Am I going MAD?? or have I just forgotten??

Posted: Fri Feb 16, 2024 9:15 am
by sln8458
Just for completness here is an image from Icad 12.0 running the same lisp:
line 2.png
line 2.png (26.04 KiB) Viewed 10494 times
The rotation is as expected, thw white line is as expected & the arc (Pline) is again as expected.

Re: Am I going MAD?? or have I just forgotten??

Posted: Mon Feb 19, 2024 8:05 pm
by QuanNguyen
Hi Steven,
Try to "Turn the osnaps off" at begin the lisp and restore when finished.

Code: Select all

(defun C:LispRoutine(/ oldOs )

  ;;;--- Save the osnap settings
  (setq oldOs(getvar "osmode"))

  ;;;--- Turn osnaps off
  (setvar "osmode" 0)
  
  
  ;; do something here
  ...
  
  
  
  ;; restore the system variables
  (setvar "osmode" oldOs)

  (princ)
)

Re: Am I going MAD?? or have I just forgotten??

Posted: Tue Feb 20, 2024 1:24 am
by sln8458
Hi Quan,

Thanks, that works :)
But why???

SteveN

Re: Am I going MAD?? or have I just forgotten??

Posted: Wed Sep 17, 2025 12:34 pm
by Pavel.Pchelnikov
sln8458 wrote:
Tue Feb 20, 2024 1:24 am
Hi Quan,

Thanks, that works :)
But why???

SteveN
The bottom line is that for release 12.1 the behavior for the OSNAPCOORD system variable was redesigned in accordance with AutoCAD.
https://help.autodesk.com/view/ACD/2023 ... F91667F641

You can not disable snaps using the OSMODE system variable, but set the desired value of the OSNAPCOORD system variable.