Jump to content
  • 6

Make Symbols Unique


MTRobin

Question

Recommended Posts

  • 0

Hi @MarcelP102 I'm glad you took my comment in the humorous vein it was intended. 😉

 

I am a little sensitive to scope creep as there have been a couple of times I have provided scripts for someone who then just kept piling on the requirements without considering that they were getting everything for free. The one that really upset me was the person who said that if it would just do XXX and YYY then could save hundreds of hours a year, but was not willing to even consider paying for that functionality and was upset when I would not do it for them.

 

@Jesse Cogswellis a great part fo the forum. I just wanted to make sure to consider what he is getting himself into.

Link to comment
  • 0

Just want to say that those who are willing to put themselves out for no recompense other than a thankyou is a really amazing community minded way to be and I for one really appreciate people like yourself, Pat and Jesse, who have that scripting skillset (amongst other skills) and are willing to put their time in. You guys are the reason this forum is so good!

 

For myself, one who finds scripting just utterly confusing, I have really benefited from that generosity. In recompense I do try to respond to questions on the forum where I might have some experience or knowledge to offer (just not in scripting!).

 

For non-scripters like myself, who don't have an understanding of what it takes to do some tasks, something may seem simple on the surface to a novice but in actual fact is hugely complicated. I hope I have never asked or expected anyone to over invest in something that! 

Link to comment
  • 0

@MarcelP102 Thank you for pointing out the bugs with mirrored symbols and layer elevations.  After fighting some of the visual anomalies caused by mirrored symbols (especially in earlier versions), I have been in the habit to duplicate symbols and mirror the 2D and 3D geometry rather than mirroring the symbol instances, so it didn't even occur to me when writing the script.  Likewise, with 90% of my drawings being done for theatre where every Z dimension wants to relate to the stage floor, I also don't use layer elevations terribly often.  Both of these issues have been patched and tested.

 

As for having the command replace multiple symbol instances, I was able to come up with a pretty simple way to implement that.  The script will now build a "Unique" version of the TOP-MOST symbol in the stacking order.  It will then search out symbols with the original symbol name within the initial selection, and replace them with the new unique symbol, and will transfer all record formats.

 

I've pretty well tested the script, and everything appears to be working correctly, but let me know if you see anything else.

 

@Pat Stanford is very right in pointing out scope-creep.  It can really easy to make requests that seem really simple, but scripting in Vectorworks can be really obtuse.  There are a lot of functions that don't really exist.  There's no simple "Replace" command to replace one symbol with another, all of that has to be coded from scratch (pull location, rotation, symbol option, and record data from original symbol, place new symbol at same location and rotation, move the new symbol based on User Origin and Layer Elevation, set symbol options, set record data, delete original symbol).

 

I don't always mind helping out or adding features to scripts, as scripting is a nice side activity to work on as a break from drafting and designing (it scratches a very different itch), and I appreciate the challenge.  This script in particular has been a godsend for my own work over this last week, and I would probably not have gotten fed up enough to script it out had I not seen someone asking for it on this forum.  And if I can add some QOL updates to Vectorworks while they're busy not fixing the features they keep adding, all the better.

 

That being said, I don't hate money.  If you feel that some of my tools are worth paying for, PM me and I will give you my PayPal handle.

 

Make Symbol Unique.zip

Edited by Jesse Cogswell
Patched infinite loop bug on symbols embedded in symbols.
  • Like 3
Link to comment
  • 0

@Jesse Cogswell Thanks for the quick update, you make it look so easy 😄😉 I did some quick tests and it works perfectly. I've send you a PM.

 

Attached is the Dutch translation of the script. For every fellow Dutchman: je moet de records vertalen door naar extra-insteek modules-beheer insteekmodules te gaan. In het tabblad 'insteekmodules van derden' kan je het script installeren en bewerken. Door op bewerken te klikken kan je de naam en teksten aanpassen.

Nederlandse vertaling - Make Symbol Unique.txt

Edited by MarcelP102
  • Like 1
Link to comment
  • 0

I think I found a bug. In a project with a lot of symbols the pop-up shows the wrong name and also duplicate the wrong symbol. But somehow this won't happen with a new file.. So I can't really find the reason why this happens. Do you have the same bug? I tried to use an old version of the script (22-07-2021) and that one works on all projects.

 

See screenshot:

Error.thumb.JPG.38b2de18711cfc68c3fc8d6caf5e13c9.JPG

 

Thanks!

 

 

Edited by MarcelP102
Link to comment
  • 0

That could be a bug with the new expanded criteria for choosing objects, it used to just use the first selected object on the active layer, but with adding functionality to do multiple selection, I had to change it.  What is likely happening is that the script is seeing a symbol that is selected on a different layer with your Layer Options set to Show/Snap but not Show/Snap/Modify.  That's one of the tricks with Vectorworks and Vectorscript, you can have an object selected somewhere you don't know about, and the script may execute on something you don intend to run it on.

 

Do me a quick favor, click Tools-Custom Selection.  Select Deselect and Execute Immediately and click OK.  For the criteria, select All Objects (should be the last item in the leftmost drop-down menu) and click OK.  Then try the script again.  If it works as expected, I'll add in some code to narrow the criteria to only symbols on the active layer, which will limit the functionality of the code for the heathens that draft with layer options set to Show/Snap/Modify.

Link to comment
  • 0

@Jesse Cogswell That seems to work! After that action the script keeps working for a while but after some time the error returns. 

 

One thing I noticed when I use the command on a group I don't get the message that I have to select a symbol. Instead the script want to make the last selected symbol unique. I suspect this triggers the error.

 

Another thing I noticed when you make a symbol unique and you try to make a symbol within that symbol unique it shows the name of the main symbol. 

 

Making a symbol unique containing spaces (with manual boundaries) flips the contour lines when the room names/labels are rotated. Offcourse I can make sure all the room labels aren't rotated so this wouldn't happen. But I thought I will let you know anyway.

 

Before:
Before.thumb.JPG.0c8d36dd8cde8e6363710a41625a9090.JPG

 

After:

After.thumb.JPG.95ee4e896a0ce5019f974d03c4567402.JPG

Edited by MarcelP102
Link to comment
  • 0

Okay, I think I got it all sorted.

 

I'm not sure about the Space stuff, I have Spotlight, so the Space tools weren't even in my workspace until this morning.  I've never used them on a drawing before, so my experience begins and ends with the 20 minutes of messing around with them this morning, and I'm not quite sure what you mean about contour lines being flipped with rotated labels.  I tested putting a Space with a rotated label in a symbol and making it unique, but could not reproduce the text moving around.  You're on your own with those.

 

I did add code to only work on symbols on the active layer, so you shouldn't have any trouble with the tool seeing an unintentional symbol.  I also patched a nasty bug where running the command on a symbol embedded in another symbol would still reference the parent symbol, creating an infinite loop when you click OK.  That should be fixed now.

 

I tested things pretty extensively in both VW2019 and VW2021 and couldn't make anything weird happen, so with any luck, this tool is finished.

Make Symbol Unique.zip

  • Like 2
Link to comment

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.

Guest
Answer this question...

×   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...