Stig Runar Posted May 16 Share Posted May 16 Hi! How can i select objects based on a field value? I want to select all IFC Objects containing the IfcPlate Name HULLDEKKE. Quote Link to comment
Hans-Olav Posted May 16 Share Posted May 16 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. 1 Quote Link to comment
Stig Runar Posted May 16 Author Share Posted May 16 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? Quote Link to comment
Hans-Olav Posted May 16 Share Posted May 16 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 Quote Link to comment
Tom W. Posted May 16 Share Posted May 16 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 🙂 Quote Link to comment
Pat Stanford Posted May 16 Share Posted May 16 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); 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.