Solved

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

Posted on 2010-09-10
5
860 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
ID: 33653299
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
ID: 33665634
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
ID: 33683987
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
ID: 33708266
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
ID: 33824568

Splitting points 400/100
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If, like me, you find yourself repeatedly and tediously joining many segments (lines, arcs) in other people's drawings back into polylines that can be used more effectively in Computer Aided Machining and Laser Cutting, then this article is for you!…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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