PDA

View Full Version : modify the plot command



sturner
2004-08-10, 09:06 PM
is there any way to modify the plot command so it calls to a lisp routine before opening the plot dialog box? i can change the button easly enough but how about the text command or menu pull down. my reason is to call a plot stamp routine. this way the user cannot turn it off and 'forget' to turn it back on.
-thanks

mjfarrell
2004-08-10, 09:17 PM
I would suggest the use of FIELDS to get the plot stamp data
then it can't be turned off.

Or take a peak at this for a hint for doing it with lisp
and further disableing the other options.

http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=2879346&linkID=2475323

Mike.Perry
2004-08-10, 09:19 PM
Hi

Probably the best method would be to use one of the following -

Events -> VBA
or
Reactors -> LISP

Would you like me to move this thread to one of those Forums?

If yes, which one, I'll then happily move it to the one of your choosing.

Have a good one, Mike

sturner
2004-08-10, 09:21 PM
but they can still erase it, no?

i'm a little more familiar with lisp than vba. so i guess the lisp forum
-thanks!

Mike.Perry
2004-08-10, 09:36 PM
i'm a little more familiar with lisp than vba. so i guess the lisp forum
-thanks!
Hi

Done, thread moved from the AutoCAD Customization Forum (http://forums.augi.com/forumdisplay.php?f=118) to this one.

I know you said LISP but you might want to take a look at the following thread within the VBA Forum -

Running a routine in everyh open drawing. (http://forums.augi.com/showthread.php?t=5010&highlight=plot+event)

Have a good one, Mike

sinc
2004-08-11, 02:53 AM
You can redefine the "plot" command to call your own custom plot command. A user with even the slightest Autocad knowledge will be able to figure out that ".plot" gets around this, but it works for complete neophytes and casual abusers of policy...

Mike.Perry
2004-08-11, 11:26 AM
i'm a little more familiar with lisp than vba. so i guess the lisp forum
Hi

If you search for <REACTOR> on the AUGI Exchange Search Page (http://www.augi.com/exchange/search.asp?page=415), 5 results should be returned. Hopefully these may help a little to get you going in the right direction.

Have a good one, Mike

peter
2004-08-11, 01:10 PM
Here is a command reactor that can run before you plot.

Peter Jamtgaard



(defun CommandReactor (objReactor lstCommand)
(cond
((= (car lstCommand) "PLOT")
(print "\nDo stuff before plot: \n")
)
)
)
(setq rxnCommand ( vlr-editor-reactor nil '((:vlr-commandwillstart . CommandReactor))))

sturner
2004-08-12, 07:37 PM
most excellent!!
-thanks

rad.77676
2004-11-16, 10:32 PM
Peter,
I am trying to setup a plotlog routine and a reactor that will not allow user to bypass plotlog dcl by typing .plot

I ran your code before plot and the following is returned when I select cancel button.

; error: no function definition: OKCALLBACK
; error: no function definition: OKCALLBACK
; error: no function definition: OKCALLBACK
; error: no function definition: OKCALLBACK
and/or
Command: .plot
; error: invalid AutoCAD command: nil

any ideas why?
Oh yeah, did I mention that I don't know spit about reactors?

luke.78920
2004-12-08, 04:08 PM
If you are just trying to stamp your plots, consider using RTEXT with a Deisel snippet instead of trying to intercept the commad reactor (use that for something else more important). You can put this line into a RTEXT object and embed it into your title block. Every regen will update the date/time variable. This string also stamps the drawing path & name.

$(GETVAR, "DWGPREFIX")$(GETVAR, "DWGNAME") - $(edtime, $(getvar,date),MO/DD/YY)

Hope this helps