Is it possible to send a command with an event handler when someone plots?

Is it possible to send a command with an event handler when someone plots?

Anonymous
Not applicable
560 Views
4 Replies
Message 1 of 5

Is it possible to send a command with an event handler when someone plots?

Anonymous
Not applicable
I have tried using the event handler BeginPlotEventHandler and SendStringToExecute to fire off a custom command before the plot executes but the command echoes after the plot is done. Is it possible to send a command while the plot dialog is up? Or is re-defuning the plot command the better option to get the command fired just before the plot dialog opens? Edited by: DeanLyon on Dec 31, 2009 6:45 AM
0 Likes
561 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
No, because the BeginPlotEventHandler fires while the PLOT or other publishing
command is running.

Does that make sense?

What is the 'custom command' you want to run?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6310931@discussion.autodesk.com...
I have tried using the event handler BeginPlotEventHandler and
SendStringToExecute to fire off a custom command before the plot executes but
the command echoes after the plot is done. Is it possible to send a command
while the plot dialog is up? Or is re-defuning the plot command the better
option to get the command fired just before the plot dialog opens?

Edited by: DeanLyon on Dec 31, 2009 6:45 AM
0 Likes
Message 3 of 5

Anonymous
Not applicable
Yes, that makes sense. I will have to redefine Plot to get the functionality I wish.
0 Likes
Message 4 of 5

norman.yuan
Mentor
Mentor
I assume you are talking on PlotReactorManager's events, such as Begin(End)Plot/Document/Page...

As Tony pointed out, you cannot run another command (by "SendStringToExecute()") because of "Plot" command being executed. However, it does not mean you cannot do something in the event handler with your code. Just do not call SendStringToExecute() for a command, built-in, or your "CommandMethod" defined command.

Depending what you want to do, writing some code in the event handlers may be much more simpler than defining your own "Plot" command. For example, I use BeginPlot/Document to keep track of plotting work done from AutoCAD, including user who does the plotting, plotter name where the plotting is done, plotting paper size and copies... All the tracking data go to a database. There is more you can do obviously.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 5

Anonymous
Not applicable
I am facing a similar problem. Hope it is alright to come in at this point.
My event handler updates a property of some Entity objects. I want to see this update shown on the display. However, it does not happen unless I click on the drawing (drawing). If I use SendStringToExceute to force a regen, will it work?

Thanks, KH
0 Likes