aage.langedrag Posted May 5, 2023 Share Posted May 5, 2023 (edited) An important feature in Autodesk Revit for effectively changing objects in large BIM models is the ability to right-click on an object and select all equally objected Styles in the entire model and change properties or replace objects with another Style. See the attached lines that describe this possibility in Revit, "Select All Instances". https://www.youtube.com/watch?v=NIyh8h_3DtM https://help.autodesk.com/view/RVT/2022/ENU/?guid=GUID-AB47C2E6-80C4-4C13-ADF1-B77775DD41D5 I have not been able to find this feature in Vectorworks. Am I not looking in the right place or is this something that doesn't exist? If this function does not exist, I would like help to create a script that will help. Suggestions on how I understand this can be done. When I have marked an object in the model, I want the script to find the Style Name of the object and then select all similar objects in the entire model. Then I can directly change properties in OPI or I can replace the objects with another Style. If we can also run a script that only searches for objects on the same Design layer and/or only among objects that are visible in the view, just like in Revit, it will be even better. We need this function since we don't necessarily have other parameters to search for that can do this job. Our models are used directly to build after so that we do not use drawings for construction. Then the model is not structured based on Attributes that the Select Similar Preferences function is based on. I am unable to use this function to make selections in the model as described above. Maybe I didn't understand this function. If I'm wrong, I'd really appreciate it if you could show me how to set this up in Select Similar Preferences. Edited May 5, 2023 by aage.langedrag 2 Quote Link to comment
grant_PD Posted May 5, 2023 Share Posted May 5, 2023 Couple of options: The magic wand tool can select similar objects by criteria on a design layer. The criteria can be saved as an option for use later. There is a menu command called custom selection, which allows you to select objects across the entire file and set up criteria for what you are selecting. You can execute immediately, or save as a script. There is a menu command called custom modification, which is allows you to select and modify across the file with criteria. You can execute immediately, or save as a script. 2 Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Thank you for your feedback. I have looked at these solutions but I cannot find an option to select By Style Name. Quote Link to comment
Jeff Prince Posted May 5, 2023 Share Posted May 5, 2023 4 hours ago, aage.langedrag said: Thank you for your feedback. I have looked at these solutions but I cannot find an option to select By Style Name. I think Grant gave you the granddaddy of selection tools "Custom Selection" in the Tools menu. It is very powerful, a bit clunky, and you really have to know what you are trying to do. It's not as quick as Revit's right click example you shared, that would be nice to have. Perhaps if you describe a few real world scenarios of what you are trying to accomplish, we can then give you a recommended Vectorworks workflow to solve it. Depending on what you want to do, there may be one or more ways of going about it, just like Autodesk products. In the example you describe in your first post, there may not be a need to search the entire drawing for a particular window in order to replace it. You just modify the style and all your windows using that style will update. Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Example from Autodesk as I use it is not to change the Style itself, but what I am looking for is to be able to select all windows of a type defined by Style name and then replace these with another Style object such as changing to a round vidu. Is that explanatory? In my project, I have 75 different Landscape areas made up of many layers and a lot of information that is included in the IFC export defined by material information. I want to be able to mark an object, have Vektorworks find all similar objects in the model that have the same Style name and replace these with another Style that I have in the Resource manager. In my case, choose all outdoor surfaces with granite and change these to asphalt. How can I achieve this today when these are not on different classes or other attributes? Quote Link to comment
Pat Stanford Posted May 5, 2023 Share Posted May 5, 2023 I think this script does what you want. It selects all the objects in the drawing that have the same PIO Style Name as the first selected object on the active layer. Lightly tested on Doors and Landscape Areas. Procedure SelectSameStyle; {©2023 Pat Stanford - pat@coviana.com} {licensed under the Boost Software License 1.0} {https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt} {TL/DR Use as you want, attribution for source, No warranty} {May 5, 2023. Script selects all objects in the drawing with the} {same PIO Style Name as the first selected object.} CONST SQ=CHR(39); VAR H1 :Handle; S1,Crit :String; BEGIN H1:=FSActLayer; DSelectAll; S1:=GetPluginStyle(H1); Crit:=Concat('INSYMBOL & INVIEWPORT & (PST=',SQ,S1,SQ,')'); Message(Crit); SelectObj(Crit); End; Run(SelectSameStyle); 3 Quote Link to comment
Tom W. Posted May 5, 2023 Share Posted May 5, 2023 Also, when it comes to Walls, Slabs + Roofs you can delete the Style in the Resource Manager + select an alternative style to replace it with. In the process all the objects in the drawing which used the first style will be replaced with the second style. Not applicable to Doors, Windows, Landscape Areas + Hardscapes but might be helpful in some circumstances. Quote Link to comment
markdd Posted May 5, 2023 Share Posted May 5, 2023 This works great on lighting pipes! A possible improvement would be that when you run the script on an Unstyled plug-in object it just selects the same Unstyled Plug-in type rather than what it currently does is select everything that is Unstyled. Just a thought. 1 Quote Link to comment
Jeff Prince Posted May 5, 2023 Share Posted May 5, 2023 59 minutes ago, aage.langedrag said: In my project, I have 75 different Landscape areas made up of many layers and a lot of information that is included in the IFC export defined by material information. I want to be able to mark an object, have Vektorworks find all similar objects in the model that have the same Style name and replace these with another Style that I have in the Resource manager. In my case, choose all outdoor surfaces with granite and change these to asphalt. How can I achieve this today when these are not on different classes or other attributes? with the "custom selection" tool and then selecting a new style in the OIP for the selected objects. It's not as elegant as simply right clicking, but it's hardly a hardship either. Almost a safety precaution against less talented operators being able to destroy a drawing by accident 🙂 Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Thanks for the Script suggestion but I'm new to using this and I can't get it to work. Attached are some pictures showing what I am trying to achieve. Greatly appreciate feedback on what I'm doing wrong. Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Hi Jeff. Thanks for the suggestion but do I have to choose the name of the Desig layer, Type and Plug-in Style myself or can I have Vectorworks find this for me? I know the actual method you show, but when I have 228 Design Layers, 75 Landscape Areas and many more Plug-in Styles, I want Vectorworks to figure this out itself based on the object I have marked in the model. Since this function is so built into Revit and we use it as one of our most important tools when working with model changes, I greatly appreciate any suggestions that can help. Quote Link to comment
Pat Stanford Posted May 5, 2023 Share Posted May 5, 2023 You seem to have it right. The language is Vectorscript. You can run it from the Resource Manager, but it is probably easier to Open the Palette and then just double click on the script name. The message box was mistakenly left in from debugging the original script. Just delete the line that says Message. The object you have selected in a symbol, not a styled object Select an object that actually has a style and try and run the script. It may be possible to write a version that will select symbols that contain styled objects, but I would need to know more about how your symbols are created to be able to figure that out. Quote Link to comment
Popular Post Pat Stanford Posted May 5, 2023 Popular Post Share Posted May 5, 2023 And here is a version that will select only PIOs of the same "type" with the same style. So when you run it on Unstyled you will only get the same type of objects. Procedure SelectSameStyleAndPIO; {©2023 Pat Stanford - pat@coviana.com} {licensed under the Boost Software License 1.0} {https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt} {TL/DR Use as you want, attribution for source, No warranty} {May 5, 2023. Script selects all objects in the drawing with the} {same PIO Name and PIO Style Name as the first selected object.} CONST SQ=CHR(39); VAR H1 :Handle; S1,PIO,Crit :String; BEGIN H1:=FSActLayer; DSelectAll; S1:=GetPluginStyle(H1); if GetParametricRecord(H1) <> NIL THEN BEGIN PIO:=GetName(GetParametricRecord(H1)); Crit:=Concat('INSYMBOL & INVIEWPORT & (PST=',SQ,S1,SQ,') & (PON=',SQ,PIO,SQ,')'); SelectObj(Crit); End; End; Run(SelectSameStyleAndPIO); 4 1 Quote Link to comment
markdd Posted May 5, 2023 Share Posted May 5, 2023 7 minutes ago, Pat Stanford said: And here is a version that will select only PIOs of the same "type" with the same style. So when you run it on Unstyled you will only get the same type of objects. This is great. It should definately be added as an option to the Select Similar Tool.... 2 Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Hi Pat. You have now saved the working day for countless people. This is fantastic. I hope your knowledge and this feature is appreciated by Vectorworks and that this comes in as a feature built into VW. Select an object, right-click and select this function. 2 Quote Link to comment
Pat Stanford Posted May 5, 2023 Share Posted May 5, 2023 You can actually make a menu command out of the script and then edit your workspace and add that menu command to the Contextual menu to be able to access it via a right click. Take a look at this post for my tutorials on how to do this. 2 Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Hi Pat. All outdoor furniture and equipment are stored as 2D/3D Symbols and of course use the same Symbol Name for similar objects. Sorry to mess this up 🙂With Symbol names I can easily use Select Similar. Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Pat. A new challenge comes when I work with plants. Here I want to be able to select all solitary plants with the same Style. Here I can use Select Similar but now have to select Object Type. For me it's hard to figure this out and keep control of when I use what but I have to practice. Surely this applies to more people than me? Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 I want to be able to select Landscape areas used as planting fields, which is what they should be used for, and select planting fields with the same Style Name. I'm trying to use the script SelectSameStyle but doesn't seem to work? Is there something I'm doing wrong? This is in a new file that I have copied over Script to. When I run the Script the OIP is reset and the object I selected is no longer selected and neither are any other objects. Quote Link to comment
Pat Stanford Posted May 5, 2023 Share Posted May 5, 2023 I specifically tested with landscape areas, so I don't know what is going on. Can you post or send me the file so I can take a look at your objects? Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Super. Attaches a link to WeTransfer for download. Let me know if you don't get access. https://we.tl/t-viuAA54318 Quote Link to comment
Pat Stanford Posted May 5, 2023 Share Posted May 5, 2023 The quote marks in your Style names are messing it up. I don't think there is an easy solution to the problem, but let me think about it. 1 Quote Link to comment
The Hamma Posted May 5, 2023 Share Posted May 5, 2023 Does @MarcelP102's script work for this? https://marcelplomp.gumroad.com/l/fqmyr Quote Link to comment
Pat Stanford Posted May 5, 2023 Share Posted May 5, 2023 Here is a version that will allow the selected object to be on any editable layer rather than on the Active Layer and will allow Style names that include single quote marks. Procedure SelectSameStyle2; {©2023 Pat Stanford - pat@coviana.com} {licensed under the Boost Software License 1.0} {https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt} {TL/DR Use as you want, attribution for source, No warranty} {May 5, 2023. Script selects all objects in the drawing with the} {same PIO Style Name as the first selected object.} {Updated Version: This version "escapes" single quotes in the} {style name prior to making the criteria string. It also uses} {a different method to get the selected object so it does not} {have to be on the Active Layer.} CONST SQ=CHR(39); VAR H1 :Handle; S1,Crit :String; Function GetSingleObject(Hand:Handle):Boolean; BEGIN H1:=Hand; GetSingleObject:=True; End; Function EscapeSingleQuotes(TheString:String):String; VAR N1,N2 :Integer; C1 :Char; WorkString :String; BEGIN WorkString:=TheString; N1:=len(WorkString); For N2:= N1 DOWNTO 1 DO BEGIN C1:=Copy(WorkString,N2,1); If C1=CHR(39) then Insert(Chr(39),WorkString,N2); End; EscapeSingleQuotes:=WorkString; END; {EscapeSingleQuotes} BEGIN ForEachObjectInLayer(GetSingleObject,2,0,6); DSelectAll; S1:=GetPluginStyle(H1); S1:=EscapeSingleQuotes(S1); Crit:=Concat('INSYMBOL & INVIEWPORT & (PST=',SQ,S1,SQ,')'); SelectObj(Crit); End; Run(SelectSameStyle2); 1 1 Quote Link to comment
aage.langedrag Posted May 5, 2023 Author Share Posted May 5, 2023 Hi The. Thanks for the link to the script. I have now tested it through the various tests shown earlier and it works on Furniture and Equipment which are 2D/3D Symbols. But for Landscape Areas both used as Hardscape and Plant Field it does not work. Not even for solitary plants. Great to be able to use this by right-clicking on the object and choosing script instead of using the Select Similar Tool and then choosing the right setting 🙂 1 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.