icon

Forum Allplan

[Domanda] Reinforcement color

Tags:
  • Reinforcement
  • Colors
  • Section

Is there a way to color different reinforcement placements as we want?
I would like to know if we can see in the 2D sections the colors that we see in the 3D animations with the colors by mark option for exemple.

I've seen that if I select some rebars and use modify format properties they change in the 2D sections but I'm not able to find how to do this from a script.

Thank you!

Show most helpful answer Hide most helpful answer

Hi Bogdan,

you would need to apply new common properties on the element adapter representing the rebars in a UVS (BarRepresentationLine_TypeUUID). Applying common properties directly on base ElementAdapters is currently not possible, but I will take that as a new feature, we should implement.

Best,
Bart

Hi Bogdan,

you would need to apply new common properties on the element adapter representing the rebars in a UVS (BarRepresentationLine_TypeUUID). Applying common properties directly on base ElementAdapters is currently not possible, but I will take that as a new feature, we should implement.

Best,
Bart

Quotato da: bmarciniec
Hi Bogdan,
you would need to apply new common properties on the element adapter representing the rebars in a UVS (BarRepresentationLine_TypeUUID). Applying common properties directly on base ElementAdapters is currently not possible, but I will take that as a new feature, we should implement.
Best,

Bart

Do you have any updates on applying common properties directly on base Elements?

Quotato da: uid-466324

Do you have any updates on applying common properties directly on base Elements?

Hi,

unfortunately, this feature didn't got the required priority to be implemented in ALLPLAN 2026. It is in our backlog, gathering for interest. Your request will contribute to higher priority.

Best,
Bart

Hi.

I have to take my words back (also these from January 2025) and apologize for the misinformation. Applying common properties (like color, pen or stroke) on a BaseElementAdapters is already possible and that as far as I can look back (definitely in ALLPLAN 2023). To my defense I have to say, it is not well documented to this day. This is what we need to improve.

How to do this (change a color of a rebar):

First, you need the list of BaseElementAdapters representing the rebar lines (BarRepresentationLine_TypeUUID) you want to change the color of. How do you obtain them depends on your workflow: via selection or by filtering all the elements in the drawing file. For now, let's assume elements is the BaseElementAdapterList containing the rebar lines and color is the color you want to apply (integer).

To change the color, call ModifyFormatProperties as follows:

properties = [
    (AllplanBaseEle.ModifyPropertyID.Color, color),
    (AllplanBaseEle.ModifyPropertyID.ColorByLayer, False),   # this makes sure, the color is not overtaken from the layer settings
    (AllplanBaseEle.ModifyPropertyID.Layer, ...),            # you may append other properties you want to modify
    ]

AllplanBaseEle.ElementsPropertyService.ModifyFormatProperties(properties, elements)

As you can see, in the documentation the function signature is wrong: you need to provide two arguments. There is no example (yet) except the Visual Scripting node "AssignFormatProperties". We will improve that ASAP. But I hope, the above helps for now.

Cheers,
Bart