Solved

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

Posted on 2010-09-10
5
849 Views
Last Modified: 2013-12-04

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).
0
Comment
Question by:kiggsondrome
  • 3
5 Comments
 
LVL 2

Accepted Solution

by:
grifster earned 400 total points
Comment Utility
You should be able to do that with a reactor.  What are you trying to do that a toolbar button doesn't work?
0
 

Author Comment

by:kiggsondrome
Comment Utility
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" ))


0
 
LVL 11

Assisted Solution

by:darrenmcwi
darrenmcwi earned 100 total points
Comment Utility
The DBLCLKEDIT system variable turns off Double-Click Editing.  Type DLBCLKEDIT at the command like or on find the toggle in the User PReferences tab of the Options dialog,

Alternaticely, you could leave this on and use the CUI editor to configure by types of objects the Double Click action that happens. You're you could have them all call a lisp routine that che4cks to see if that particular item should call your reactor or continue to display the properties dialog.
0
 

Author Comment

by:kiggsondrome
Comment Utility
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.
0
 

Author Closing Comment

by:kiggsondrome
Comment Utility

Splitting points 400/100
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Our company has proprietary drawing files that we do not give to our customers for final documentation. Our customers now require that we give them these drawings. They understand that they are proprietary and do not require them to be in AutoCAD bu…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now