Hi,
I'm building automated wall reinforcement detailing (headless via a bridge PythonPart, and interactively via PythonParts). I want to reproduce the **collective label** that the interactive labeling command produces: **one label bubble + N leaders + a live total bar count**, spanning **all placements of one mark** (in my case a mark placed across 4 **non-collinear** `BarPlacement`s — a T-node corner, not a single line).
**The interactive command works** (trace shows `EVENT_BEW_ML_TE`, eventID 7020; leaders are internal type `BEWEHRUNG_ZEIGER`/413; it does `Elementaktivierung geschnitten` = per-rebar activation). I want the programmatic equivalent.
## What I tried and where it stands
**Per-placement `BarLabel` works** but is per-placement only:
- `BarLabel(LabelWithFan, mark, prop, pt, Angle())` + `ShowAllBars(True)` + `SetVisibleBars(-200..200)` labels one placement's bars. `SetPointerStartPoint(P)` forces all its leaders to a common point.
- `ShowBarCount` then shows that placement's count (e.g. 2), not the mark total (16). I found no property for a mark-total count.
- Passing N reps (same mark) in one `CreateReinforcementLabeling` call, with the label on one rep or a shared instance on all, produces **N separate labels**, never one collective.
**The section route crashes on my geometry.** Following the pattern from the "Circular placement labeling" thread:
```python
label = ReinforcementLabel(Bar, LabelWithFan, mark, prop, labelPoint, Angle())
labels = ReinforcementLabelList(); labels.append(label)
sect = ViewSectionElement()
sect.SectionDefinitionData = ... # horizontal section, DirectionVector (0,0,-1)
sect.GeneralSectionProperties = ...
sect.ReinforcementLabels = labels
CreateSectionsAndViews(doc, Matrix3D(), elements, [sect], viewWorldProjection [, undo])
```
This **crashes Allplan with `C0000005` (access violation) in the `TextPtr` subsystem**, during the fan-leader rendering, right after MarkNumbering completes cleanly. It crashes identically:
- via the bridge (captured projection), **and**
- in an interactive PythonPart with the **real** `coord_input.GetViewWorldProjection()`.
It works for a **single** circular/linear placement (as reported in that thread). It only crashes when the mark spans **multiple non-collinear placements**.
**Other routes I ruled out:**
- `BarsOperations.JoinBarsPlacements(placements, fillEdges)` → "Wrong element type" (bars are non-collinear, not one line).
- `BasisElements.LabelElement` + `SetLabeledElement` → attaches to a placement in-memory (`GetLabelElements()==1`) but `ModifyElements`/`CreateElements` don't persist or render it headless; and `SetLabeledElement` is singular (one element).
- `AssociationService` is PythonPart-association only; `GetObservedElements(collectiveLabelUUID)` returns empty for the native collective label.
- Copying the placed collective (GUI or `CopyElements`) yields a **frozen** copy (leaders don't follow moved bars; only the bubble's data stays live).
## Questions
1. Is creating a **collective label across multiple non-collinear placements** of one mark supported through the Python API at all?
2. Is the **`C0000005` crash** (fan-leader rendering in `TextPtr`, for a mark spanning multiple non-collinear placements, via `ViewSectionElement.ReinforcementLabels`) a known limitation/bug — or am I calling it wrong (label-point coordinate frame? section setup?)?
3. What is the **correct call sequence** for the programmatic equivalent of the interactive `EVENT_BEW_ML_TE` (7020) command, which associates one label with individual rebars across placements?
4. Is there a **per-bar labeling API** (associate one label element with specific bars / multiple docking points), so I could compose the collective myself from live, associative pieces (and get a live total count)?
Any pointer would save a lot of manual multi-select. Thanks!
Best regards,
Lucian