Jump to content
Developer Wiki and Function Reference Links ×

Novice with user interface question

Recommended Posts

I've never used marionette before, but I've recently come up with a file management reason to potentially do so.

We have recently shifted our class naming system to better align with AIA standard.

I'm looking to write a script to automate this process for an older project which has been called back to the boards.

I've found the Rename Class node that seems like it may be productive to this end, but I'm stuck on the most basic user interface hangup as I'm not seeing the blue dot reshape handles when I click on any of these nodes.  I have not grips to connect one node to another. 

Is there a switch I've left off somewhere?


Link to comment

The first thing to look for is that the "Interactive Scaling Mode" is not disabled.  This will hide all reshape handles and control points, including the ones necessary to join Marionette nodes.  You can find in the the menu bar in the upper left when you have the Selection Tool active.  You want to make sure that you have either the second or third option active, not the one with the big "no" sign (as in the the picture below).


  • Like 1
Link to comment
  • Vectorworks, Inc Employee

I also would like to mention that there is a Batch Rename command in the Tools menu that allows you to find and replace, add prefixes, suffixes, etc. This was not available when the Rename Classes Marionette menu command was posted to the forum. Because you would have to run it and set it every time you opened a new file, the menu command wouldn't really be any better than using the Batch Rename command. 

  • Like 2
Link to comment
On 12/7/2021 at 12:55 PM, Pat Stanford said:

I personally think this would be easier as a script than as a Marionette.  Create a worksheet or text file showing the old and new names and it would only be a few lines of code to make the swaps.

That would be amazing Pat, I'm sure a a lot of people would find it very useful, I have a current jobs where huge numbers of classes are needing to be changed as new data comes to light. It's basically impossible currently as too time consuming.


The worksheet idea is very good too as it would enable keeping earlier versions of class names.

Link to comment
  • 2 weeks later...
On 12/6/2021 at 6:55 PM, Pat Stanford said:

I personally think this would be easier as a script than as a Marionette.  Create a worksheet or text file showing the old and new names and it would only be a few lines of code to make the swaps.


After trying the Batch Rename tool, I think this idea of a script it the best tool. 

Though I understand in concept, after a few attempts to dip my toes into Vector Scripting, I feel certain that I lack the basic skills to accomplish this.


I have built a custom worksheet off of the 'ClassNameStds' worksheet which is a part of VW.

In addition to those naming standards, this worksheet has our old and new class names.

I'm hoping that the 'few lines of code' can be written to walk down the rows of the worksheet to change every class name in a single operation.

That way we can use it as a regular operation to tidy up files when archived projects come back online or when old resources/symbols are imported to newer projects.


IF that is a script that can be written, then it would be more effective to this purpose than the Batch Rename tool, the Rename Classes Marionette Wrapper or other scripts that I have found on the Forum, because so far each of those appear to require user input for the find and replace for each class as a separate operation.


I'm looking for something more automated to run the find and replace through the entire class list.

But I'll need to hire a programmer to do it.


Link to comment
  • 1 month later...

If anyone still needs this, here is a script that will take a selection of two columns in an open VW worksheet and rename the classes in the first column to the matching name in the second column.


Ask if you need more information.


Procedure RenameClassesFromWSSel;

{January 27, 2022}
{Converted Script originally written to create Classes from a Worksheet}
{And modified it to rename classes based on the original and new names}
{matched in two worksheet columns. Select a range in the WS and run script}
{December 7, 2016}
{© 2022, 2016, Pat Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

{Creates classes from a list of class names in an open worksheet.}
{Select a single column range in a worksheet containing the names}
{of the desired classes. Run the script. Names in the selection that}
{are not currently classes in the file are created. The Active Class}
{is reset at the end of the script the what it was before running}
{the script.

{Lightly tested. Use at your own risk. Save before running the script.}
{Do not operate ocean going or interstellar vehicles while using}
{this script.}

Var	CurrentClass,OrigClass, NewClass:String;
	CurrentClass:=ActiveClass;   {Store the Active Class before the script}
	WSHandle:=GetTopVisibleWS;   {Get the top open worksheet}

	If WSHandle <> Nil then			{Make sure a WS is open}
			{Get the selected cells in the worksheet}

			If C2-C1=1 then  {make sure two columns are selected}
					For ThisRow := R1 to R2 do   {repeat for each row in the selection}
							GetWSCellString(WSHandle,ThisRow,C1,OrigClass);  {get the original class name from the cell}
							GetWSCellString(WSHandle,ThisRow,C2,NewClass);  {get the desired class name from the cell}
							If ((GetObject(OrigClass)<>nil) AND (NewClass<>'')) THEN
									RenameClass(OrigClass,NewClass);    {Create the class and make it active}
				AlrtDialog('Select exaclty two columns of data.'); {Notify if wrong number of columns selected}

			{Notifiy if a worksheet is not open}
			AlrtDialog('Must have a Worksheet open and part of two columns containing the Original and New Class names selected.');
	NameClass(CurrentClass);	{Restore the active class from before script}



  • Like 1
Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...