Jump to content
WhoCanDo

Custom Search IFC records

Recommended Posts

Hi, I can't get the following custom search to work to find this IFC record object. Any suggestions please?

 

8753732_Annotation2019-12-10124527.thumb.jpg.57a0a1c2a978dd0e88db38444ba8a400.jpg

Share this post


Link to post

No luck. 'Tekla Bolt.Bolt Name' didn't work either.

 

The record 'Tekla Bolt' does exist with the field line 'Bolt Name' but this record is not attached to the object.

 

I'm trying to select the Bolt Name from the ifc record.

 

Any other ideas?

Share this post


Link to post

Can you attach a sample file with an instance of the Tekla Bolt with the IFC record attached? Or tell me a simple way to create a file with this object type so I can see what is happening?

 

Share this post


Link to post

Thanks Pat, I knew you'd enjoy the challenge.

 

The attached drawing (vw2020 because it wouldn't import in vw2019) has one of the components from an imported .ifc drawing from our client.

 

After importing the vary complex drawing, I wanted to move various components to other layers so I could work with them.

 

I found that I couldn't "Custom Selection" "Field Value" "Tekla Bolt" "Bolt Name".

 

This maybe because, even though these categories list in "Custom Selection", if you look at the Object Info, it's actually a sub-catagory of ifcMechanicalFastener, which is ignored by "Custom Selection".

 

What do you think?

Untitled1.vwx

Share this post


Link to post

I believe I have a solution for you.

 

Use SelectObj with the criteria (IFC_ENTITY='IfcMechanicalFastener') to get all IFC entities that even could have the field "Tekla Bolt".

Then make a loop to go through all selected objects using IFC_GetPsetProp to check for the value of "Tekla Bolt".

 

Share this post


Link to post

Thanks Antonio,

 

I'll have a go using your suggestion, but unfortunately I don't have the time at the moment.

 

Without the time to do this, I resorted to the inbuilt search option that doesn't work for me, even though the list of ifc records are listed. Maybe this is a bug that needs to be reported or maybe I'm using it incorrectly.

 

Regards

Share this post


Link to post

First the background.

 

The Vectorworks IFC implementation uses Record Formats to generate IFC PSets which are basically pulled into the IFC record. This effectively give an extremely extensible record format, but also makes it 'interesting' to get at that IFC Data programmatically. In a worksheet you can use the GetIFCProperty function to tell the worksheet what IFC Pset and Field (Property) to return. But there is no way to use an IFC PSet Property as part of a criteria.  This should be submitted as a Wish/Enhancement request. Or at the very least be able to tell if a given Pset is part of the IFC record.

 

So the following script will select every object in a drawing that has an IFC Type of "IFCMechanicalFastener" AND has a non-blank 'Tekla Bolt'.'Bolt Name' as part of the IFC record. This could be relatively easily adapted to other IFC object types, PSets, and properties by editing the string constants in the script.

 

Procedure SelectByIFCProperty;

{December 13, 2019}
{© 2019 Patrick Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

{Selects all objects that are defined as IFCMechanicalFastener }
{and have an IFCPSet of Tekla Bolt with a non-blank Bolt Name attached.}

{Here be dragons. No Warranty Expressed or Implied. Use at your own risk}

Var
	B1:Boolean;
	S1,S2,S3,S4:String;
	N1:Integer;
	
Procedure Execute(H1:Handle);
		Begin
			B1:=IFC_GetPSetProp(H1,S3,S4,S2,N1);
			If ((B1=True) & (S2<>'')) then SetSelect(H1);
		End;
Begin
	
	S1:='Tekla Bolt.Bolt Name';
	S3:=Substring(S1,'.',1);
	S4:=Substring(S1,'.',2);
	
	DSelectAll;
	ForEachObject(Execute,((IFC_ENTITY='IfcMechanicalFastener')));
End;

Run(SelectByIFCProperty);
	

 

  • Like 1

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...