Jump to content

Script to sort in classes IFC elements by IFC material ?


GatRed

Recommended Posts

Hi,

I need help to make an operation I think could be quite common.

I’m working on a big project with an existing building. We received a really big IFC model of the building.

I would like to classify the elements in different classes following the IFC - material - component 1 field, so I can defined attributes by classes and have a coherent representation of the IFC file in plan and sections.

Is there a way of doing that by script ?

- select objects

- for each object (Object) :

   · get the class (ObjectClass)

   · get the IFC-material-component 1(ObjectIfcMaterial)

- create class named ObjectClass-ObjectIfcMaterial

- assign the class ObjectClass-ObjectIfcMaterial to Object

 

For example in the attached file :

There is a beam IfcEntity object. Its class is 3D.S-POUTRES and the IFC material component 1 is Acier structurel - S235

The goal would be the automatically assign a new class named  3D.S-POUTRES-Acier structurel - S235.

 

Does someone can help me with that ?

(maybe @PatStanford?)

 

Thanks !

Vectorworks Script.vwx

 

  • Like 1
Link to comment

I manage to make something with marionette.

But I had some trouble with the concat node, it doesn’t concatenate each item of lists to make a list result.

for example

3 lists : A; B; C with for each 3 items inside : 1, 2, 3.

If I use the concat node the result is a string : A1 A2 A3 B1 B2 B3 C1 C2 C3

and I wanted to have one result list : A1 B1 C1, A2 B2 C2, A3 B3 C3.

@Marissa Farrell did I miss something ?

 

I found a concat node made by @DomC which does what I needed (thank you !)

Here is the file with the result.
If anybody has some improvement to suggest…Capturedcran2023-11-0714_28_07.thumb.png.c1d8043c6d32b838a6cdad1450ddc729.png

Vectorworks Script.vwx

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