JenWilliamson Posted December 5, 2021 Share Posted December 5, 2021 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? Quote Link to comment
Jesse Cogswell Posted December 5, 2021 Share Posted December 5, 2021 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). 1 Quote Link to comment
JenWilliamson Posted December 6, 2021 Author Share Posted December 6, 2021 Thank you for the response. I did look there, and I didn't have scaling disabled. I'm a little intimidated by the preference menu (the wrench and pencil button that appear when selecting the marionette tool from the basic tool palette). I can imagine that one of those needs to be marked. Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted December 6, 2021 Vectorworks, Inc Employee Share Posted December 6, 2021 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. 2 Quote Link to comment
Pat Stanford Posted December 6, 2021 Share Posted December 6, 2021 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. 4 Quote Link to comment
JenWilliamson Posted December 8, 2021 Author Share Posted December 8, 2021 Thank you for comments, I really appreciate them. And thank you for bringing the Batch Rename command to my attention. I also worked out where my handles were. I was in 'Top' view and not 'Top/Plan' view, which is why they were not displaying. Quote Link to comment
unearthed Posted December 8, 2021 Share Posted December 8, 2021 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. Quote Link to comment
JenWilliamson Posted December 19, 2021 Author Share Posted December 19, 2021 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. Quote Link to comment
Pat Stanford Posted January 27, 2022 Share Posted January 27, 2022 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; R1,C1,R2,C2,CurrentRow,CurrentCol,ThisRow:Integer; SR1,SC1,SR2,SC2:Integer; WSHandle:Handle; B1:Boolean; Begin; 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} Begin {Get the selected cells in the worksheet} GetWSSelection(WSHandle,CurrentRow,CurrentCol,R1,C1,SR1,R2,C2,SR2); If C2-C1=1 then {make sure two columns are selected} Begin For ThisRow := R1 to R2 do {repeat for each row in the selection} Begin 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 Begin RenameClass(OrigClass,NewClass); {Create the class and make it active} End; End; End Else AlrtDialog('Select exaclty two columns of data.'); {Notify if wrong number of columns selected} End Else Begin {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.'); End; NameClass(CurrentClass); {Restore the active class from before script} End; Run(RenameClassesFromWSSel); 1 Quote Link to comment
JenWilliamson Posted February 7, 2022 Author Share Posted February 7, 2022 Thank you very much for posting this. I will try it out later this week after deadline. Quote Link to comment
Recommended Posts
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.