Link to home
Start Free TrialLog in
Avatar of kiggsondrome
kiggsondrome

asked on

ACAD: Run lisp by clicking a object/button inside the dwg


I want to execute lisp by clicking an object/button inside the dwg.
Using a hyperlink didn't really work yet, i hope there is a solution
to start the lisp with one click from within the drawing (not from
the toolbar).
ASKER CERTIFIED SOLUTION
Avatar of grifster
grifster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kiggsondrome
kiggsondrome

ASKER

I'll possibly need up to 200 buttons that will only be
relevant to small areas of the dwg.

The following object reactor works when double clicking
on an object with the handle "DF42".
Does someone have an idea how i can suppress the double
click bringing up the properties box when i double click
the reactor object/button?


(vl-load-com)
(setq react1 (vlr-mouse-reactor nil '((:vlr-beginDoubleClick . dbclick))))
(setq docacad (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))

(defun dbclick (object-reactor point-reactor )
(alert "DoubleClicked")
(setq numhandle (cdr (assoc 5 (entget (cadr (reverse (nentselp (car point-reactor))))))))
(princ numhandle)
(if (= numhandle "DF42" )
(tester)))

(defun tester ()
(alert "tester function started" ))


SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Turn off double clicking from a lisp works well but is there
a way to switch on DLBCLKEDIT after the clicks actually occur.
Something like a scheduled macro that executes 1 second after
the lisp ends? I made a few tries with vba but no luck yet.

For the other method in the CUI do i have to edit config files?
The button functionality in my drawings should be backwards
compatible to about acad2000 if possible.

Splitting points 400/100