Hello,
I am developing a PythonPart for Allplan 2022 that automatically generates native sections of existing architectural walls.
I would like to create a **native associative attribute label** in a generated section, linked to the original WallTier element, so that the label automatically updates when the wall's Object Name (attribute 498) changes.
What already works:
- Retrieving the existing WallTier's BaseElementAdapter.
- Reading attribute 498 from the original wall.
- Creating a native GeneralVariableTextBlock using TextElement with TextType.eVariableText and the `[at]498[at]` attribute formula.
- Calling `SetBaseElementAdapter(wall_adapter)` on the TextElement.
The problem:
Although the native GeneralVariableTextBlock is created successfully, it is not associated with the original wall. It displays the attribute placeholder instead of the wall's actual name.
A manually created associative label works correctly. We confirmed that the manual label is a child of the UnifiedSection, whereas the programmatically created GeneralVariableTextBlock is a standalone element.
We also tried `LabelElement.SetBaseElementAdapter()` and `UnifiedSection.SetLabelElements()`, without successfully creating a native associative label. A separate `CreateElements()` call with a LabelElement caused Allplan to crash.
My questions:
1. Is there a supported Allplan 2022 Python API method to associate an existing WallTier with a GeneralVariableTextBlock or LabelElement?
2. Can this association be established when creating a native UnifiedSection using `CreateSectionsAndViews()`?
3. Is there an Allplan 2022 equivalent of the newer `LabelElement.SetLabeledElement()` method?
4. If this is not supported in Allplan 2022, which Allplan version first introduced this capability?
A minimal working code example or confirmation of this API limitation would be greatly appreciated.
Thank you!