Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-10
5
Medium Priority
?
878 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 1600 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 400 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The following article will describe how to add/edit a dimension style through AutoCAD VBA. AutoCAD VBA has its quirks and when it comes to dimensions and controlling how they look through VBA.  This is where AutoCAD can be vividly confusing. The…
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 response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

876 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