icon

Change line color of model objects using IFC Entity (Visual Scripting) in Allplan2024

Tagy:
  • Allplan2024
  • Visual
  • Scripting
  • BIM

Hello everyone,

I am trying to change the **line color of existing model objects** using **Allplan Visual Scripting (Workflow type)**.

Objective

Filter objects by IFC Entity
If IFC Entity = IfcBeam
Set line color = 2

Issue

When using `GetObjectAttributes`, I can see the IFC Entity attribute, but the attribute value does not return values such as `IfcBeam`, `IfcWall`, etc.
Instead, it only shows the attribute name.

Questions

Is the IFC Entity a calculated or export-based attribute that cannot be directly read in Visual Scripting?
Which attribute is recommended to reliably identify IfcBeam objects (e.g. IFC Object Type)?
Is the following workflow correct for this task?

GetObjectAttributes
OperatorEqual (AttributeValue == "IfcBeam")
ListItemsByStateList
ModifyModelObject (Line color = 2)

Any guidance or best practices would be greatly appreciated.

Thank you very much for your help.

Show most helpful answer Hide most helpful answer

I would use following script node (see script.png)

SelectAllObjects
AttributValueConditionFilter
ColorInput
AssignFormatProperties

Přílohy (2)

Type: image/png
Staženo 62
Size: 105,50 KiB
Type: application/zip
Staženo 178
Size: 7,08 KiB

I would use following script node (see script.png)

SelectAllObjects
AttributValueConditionFilter
ColorInput
AssignFormatProperties

Přílohy (2)

Type: image/png
Staženo 62
Size: 105,50 KiB
Type: application/zip
Staženo 178
Size: 7,08 KiB

Thank you so much for the support,

I have one follow-up question:
Is it possible to handle two or more IFC entities in a single workflow?

For example:

IfcBeam → line color = 2

IfcColumn → line color = 5

I tried implementing this logic using lists (multiple IFC entities with corresponding colors), but the script was not able to process the data correctly.

Is there a recommended approach or best practice in Visual Scripting to apply different formatting rules to multiple IFC entities at the same time?

I don't quite understand the purpose of the script.
Do you really want to recolor all elements depending on the IfcItem attribute? Why?

If it's just a matter of checking the correct values for the “IfcEntity” attribute, it's much easier to do this with the ObjectPalette.
In Allplan 2026, it will be even easier with “Graphic override”!

Přílohy (2)

Type: image/png
Staženo 30
Size: 105,01 KiB
Type: image/png
Staženo 29
Size: 40,08 KiB

I would like to experiment with multiple data values. In my case, there are four elements named under IfcMember, and I want to automatically apply different colors to each element type using a rule-based approach, rather than selecting them manually. This is especially important when working with large datasets.

I am currently new to Allplan Visual Scripting, and the script you shared was very helpful for my learning.

Thank you!

Přílohy (1)

Type: image/png
Staženo 25
Size: 425,86 KiB

Hi,

I made custom vs nodes included a match / case (for ALLPLAN 2026 - using Plugin Manager)

here

Best
Christophe