Jump to content
Developer Wiki and Function Reference Links Read more... ×
Matthias Ganninger

Creation of temporary objects while tool is active

Recommended Posts


we want to display 3D-objects (e.g. extrudes) while one of our tools is activated.


To do that we create the objects during VWTool_EventSink::DoSetUp and remove them during VWTool_EventSink::DoSetDown (we don't add them to the undo system).

However those objects are not immediately visible in the drawing, only their selection geometry is visible.

They become visible as soon as we create another object and create an undo step for that (e.g. in VWTool_EventSink::HandleComplete).

Is there a way to create 'temporary' objects (objects that don't land on the undo stack) which are immediately visible during a tool's DoSetUp?



Share this post

Link to post

The Setup/SetDown events run when the tool is selected and de-selected. You might want to try as part of the GetStatus or UpdatePreview events. You may also need to manually invoke a screen redraw.

Share this post

Link to post

I tried to invoke a screen redraw, but I can't really find out how to do it.

I played around with ISDK::RedrawRect without any effect.


Any hint, how to invoke that redraw?


Share this post

Link to post

We created a small vs script with only one function in it (http://developer.vectorworks.net/index.php/VS:ReDrawAll) and call this one if we need to redraw the screen. Can be even created "on the fly" from within the code, something like this should work:

TXString script;
script += "import vs;";
script += "vs.ReDrawAll();";

VectorWorks::Scripting::IVectorScriptEnginePtr vsEngine(VectorWorks::Scripting::IID_VectorScriptEngine);
bool outWasCompiledSuccessfully;
Sint32 outLineNumberOfSelectedError;
TXString outErrorText;
if (VCOM_SUCCEEDED(vsEngine->CompileScript(script, false, outWasCompiledSuccessfully, &outLineNumberOfSelectedError, &outErrorText)))
    if (VCOM_SUCCEEDED(vsEngine->ExecuteScript(script)))
        // SUCCESS...


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.