Solved

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

Posted on 2010-09-10
5
872 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

630 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