Author Topic: acrx_cmd_transparent, again !  (Read 1246 times)

0 Members and 2 Guests are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 743
acrx_cmd_transparent, again !
« on: November 12, 2023, 07:13:54 AM »
Code - Auto/Visual Lisp: [Select]
  1. (defun :POINT2D>STRING (pt) (strcat (rtos (nth 0 pt) 2 12) "," (rtos (nth 1 pt) 2 12) ) )
  2.  
  3. (defun :ADD-TRANSPARENT-CMD (sym-func-name / str-func-name)
  4.    (setq str-func-name (vl-symbol-name sym-func-name) )
  5.    (vlax-remove-cmd str-func-name)
  6.    (vlax-add-cmd str-func-name sym-func-name str-func-name acrx_cmd_transparent)            
  7. )
  8.  
  9. (defun PR ( / ang dist ptr r)
  10.    (initget "X")
  11.    (setq ptr (getpoint "\n[eXit] reference point <lastpoint> :") )
  12.    (cond
  13.       ( (not ptr  )   (setq ptr (getvar "lastpoint") ) )
  14.       ( (= ptr "X")   (setq ptr nil)   )
  15.    )
  16.    (and
  17.       ptr
  18.       (setq ang  (getorient  "\ndirection <exit> : ") )
  19.       (setq dist (getdist "\ndistance <exit> : ") )
  20.       (setq r    (polar ptr ang dist) )
  21.       (vla-SendCommand (vla-get-activedocument (vlax-get-acad-object)) (strcat (:POINT2D>STRING r) "\n") )
  22.    )
  23. )
  24.  
  25. (:ADD-TRANSPARENT-CMD 'PR)

This code WORKS WELL
TRANSPARENTLY in ACAD COMMAND and LISP ROUTINES ...
but
only if I enter inputs from keyboard and not using the mouse
because the mouse is locked while this code is running !

For istance :
PLINE ... point ... point ... 'PR
(from this moment the mouse is locked)
but it is possible to enter inputs using the keyboard ...
... and every thing goes normally ...
...
I want know why the mouse is locked while the code is running !
« Last Edit: November 12, 2023, 07:19:08 AM by domenicomaria »

domenicomaria

  • Swamp Rat
  • Posts: 743
Re: acrx_cmd_transparent, again !
« Reply #1 on: November 13, 2023, 09:59:05 AM »
a friend of mine tested the code in ACAD 2024,
and it works well!

So it depends from the version of ACAD !

I'm curious if there are any problems in BricsCAD ...

mhupp

  • Bull Frog
  • Posts: 250
Re: acrx_cmd_transparent, again !
« Reply #2 on: November 13, 2023, 12:21:08 PM »
i think you also need to tell it where to put the point. not just the active document but model space or paper space.

Code - Auto/Visual Lisp: [Select]
  1. (setq mspace (vla-get-ModelSpace doc))
  2. (vla-SendCommand doc mspace (strcat (:POINT2D>STRING r) "\n"))

domenicomaria

  • Swamp Rat
  • Posts: 743
Re: acrx_cmd_transparent, again !
« Reply #3 on: November 13, 2023, 01:10:51 PM »
@mhupp

ok ... but the main problem is the one I asked in my initial message ... to you, the mouse freezes or not?

When it asks the reference point,
is it possibile to enter a point
using the pointer ?
« Last Edit: November 13, 2023, 01:13:54 PM by domenicomaria »