Jump to content

Select by IFC field value


Recommended Posts

2 hours ago, Hans-Olav said:

Hei Stig Runar!

I would try to set up a worksheet, searching for IFC and field values 

You would get a rows for every item and could the right-click each row to select the item.

That was a good solution! Only downside was that you can only select one line at a time.. Or is there an other solution?

Link to comment

There might be a possibility to use the Data Manager and assign a class or record to every HULLDEKKE to make it simpler to isolate or select them. I have only limited experience with the Data Manager so I can't really help 

Link to comment
22 minutes ago, Stig Runar said:

Or is there an other solution?

 

I'm guessing it's possible to write a SelectObj() script that would select every HULLDEKKE object in one go but my quick + very feeble attempt didn't work 🙂

Link to comment

I don't believe there is a way to use IFC field values as part of a Criteria.

 

This script will look at every IFCPlate in the file and only select the ones that have the name entered in the dialog box.  Comment out the StrDialog line to suppress the dialog box and always look for 'HULLDEKKE' or whatever other name you put into the MyName variable.

 

Procedure SelectByIFCPlateName;
{©2024  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}

Var MyName:String;

Procedure Execute(Hd1:Handle);
VAR	B1:Boolean;
	S1:String;
	N1:Integer;
BEGIN
	B1:=IFC_GetEntityProp(Hd1, 'Name', S1, N1); 
	If S1=MyName Then SetSelect(Hd1);
End;

BEGIN
	{change the value in the following line to the IFCPlate Name that you want to select}
	MyName:='HULLDEKKE';
	{Comment out the following line (Put curly braces on each end of the line like this one) to suppress the dialog box.}
	MyName:=StrDialog('Enter the name of the IFCPlate(s) to select. Capitalization matters.', MyName);
	DSelectAll;
	ForEachObject(Execute, ((IFC_ENTITY='IfcPlate')));
End;

Run(SelectByIFCPlateName);

 

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