Jump to content

How can I select similar objects in Vectorworks where the similarity is controlled by Style Name and not Symbol Name or Object Name


Recommended Posts

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 by aage.langedrag
  • Like 2
Link to comment

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.

  • Like 2
Link to comment
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.  

 

Link to comment

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?

Link to comment

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);

 

  • Like 3
Link to comment

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.

Link to comment

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.

  • Like 1
Link to comment
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 🙂

 

 

1027524240_ScreenShot2023-05-05at10_15_54.thumb.png.531a24b2698758bc93a0c8f5f1340b2a.png

 

 

 

Link to comment

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.

Link to comment

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.

 

 

Link to comment
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....

  • Like 2
Link to comment

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? image.thumb.png.78c706340420435070fb564ffc61b6c9.png

Link to comment

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.image.thumb.png.c937b874459c9a976d48fdf53c389773.png

When I run the Script the OIP is reset and the object I selected is no longer selected and neither are any other objects.

image.thumb.png.be29bf979f4bb6941f7cc4d014b43763.png

Link to comment

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);

 

  • Like 1
  • Love 1
Link to comment

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 🙂

  • Like 1
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
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...