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

Class Creation during a tool's DoSetUp (Beta Undo Alert 9)

Recommended Posts

Posted (edited)



I am implementing a tool event sink by inheriting from VWFC::PluginSupport::VWTool_EventSink.


During DoSetUp I want to create a Vectorworks class if it doesn't already exist in the current document.
When trying that many "Beta Undo Alert 9" - warnings are thrown at me (see  attached image).


I tried to create an Undo step around the class creation but that did not help.
What am I missing here? Is there a recommended way of creating a class during DoSetUp without drowning in Beta Undo Alert 9 warnings?



VWSDK - ClassCreation.png

Edited by Matthias Ganninger

Share this post

Link to post

The general practice would be to do something like:


// Create class newClassName
if (VWClass::IsValidClassName(newClassName)) {
    gSDK->SetUndoMethod( kUndoSwapObjects );
    gSDK->NameUndoEvent("Create default classes");
    VWClass classObjNew(newClassName);
    MCObjectHandle classH = gSDK->InternalIndexToHandle(classObjNew);


Share this post

Link to post

I had this happen as well but was not working in class when it was occurring. Any thoughts?

Share this post

Link to post

You see this alert any time an action changes the document without properly registering with the undo system. It could be your code or it could be from another module. If you are running a debug session, you can pause execution when the alert pops up and try to track it down. 

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.