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