.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
487 Views, 4 Replies

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

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
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

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
Message 3 of 5
Anonymous
in reply to: Anonymous

Yes, that makes sense. I will have to redefine Plot to get the functionality I wish.
Message 4 of 5
norman.yuan
in reply to: Anonymous

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

Message 5 of 5
Anonymous
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost