cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Cyril Phelizon
Participant

Try to Create associative Dimensions with tapir and claude

Hi there !

I'm trying to Create associative Dimensions with tapir and claude.

But Claude told he than was impossible for now. 

Here is his report :

CreateAssociativeDimensions: witness points never resolve for Zone/Slab elements, and CreateAssociativeDimensionsOnSection always fails to find a valid section

Tapir version: 1.5.5 Archicad version: 29 Tested via: archicad-mcp (wraps TapirCommand.CreateAssociativeDimensions / CreateAssociativeDimensionsOnSection / GetDimensionData)

Summary

Two related issues with associative dimension creation:

  1. CreateAssociativeDimensions witness points resolve correctly (real coordinates, correct dimensionValue) when elementId points to a Wall, Line, or Polyline, using only elementId + inIndex (1 or 2 — the two endpoints of the element's own reference line). However, witness points never resolve when elementId points to a Zone or a Slab — every combination of inIndex / nodeId / special / nodeType / nodeStatus I tried returns a witness coordinate of {0, 0} (and the created Dimension element is visually degenerate / invisible), even though the command itself reports success and returns a valid element GUID.

  2. CreateAssociativeDimensionsOnSection fails with "The referenced 'sectionElementId' is not a valid section element" for every CutPlane element in the project I tested against — including sections that existed in the file before any scripting (not just ones created via CreateSections), and regardless of which ID I passed (the elementId returned by CreateSections, the navigatorItemId found via GetNavigatorItemTree, the databaseId returned by GetDatabaseIdFromNavigatorItemId, and the elementId returned by GetElementsByType("CutPlane") — all four candidates fail identically).

Issue 1: witness points on Zone/Slab

Repro steps

  1. Create or select a Wall, and a Zone, in the same project.
  2. Call CreateAssociativeDimensions with witnessPoints referencing the Wall's elementId, inIndex: 1 and inIndex: 2 (no other witness fields set). → Works. GetDimensionData on the result shows the witness coordinate matching the wall's begCoordinate/endCoordinate exactly, and dimensionValue equals the true distance.
  3. Repeat the exact same call, but pointing elementId at a Zone instead (inIndex: 1 / inIndex: 2, referencing the zone's first two polygonOutline vertices). → The command reports success and returns a valid Dimension GUID, but GetDimensionData shows both witness points with coordinate: {x: 0, y: 0}. The resulting Dimension is not visible in the model (confirmed via Get2DBoundingBoxes returning "Element not supported", and FitInWindow on the element falling back to a whole-project zoom instead of centering on any real geometry).
  4. Same result for a Slab element (tested with a slab whose polygonOutline matches the zone's, confirmed via GetDetailsOfElements).

What I tried on Zone/Slab witness points, all resulting in {0,0}

  • elementId only (all other fields omitted/null)
  • inIndex 0, 1, 2 (matching real vertex positions in polygonOutline)
  • inIndex + nodeId (1, 2)
  • inIndex + special (1, 2)
  • inIndex + nodeType (1, 2)
  • inIndex + line: true

Additional confirmation this is Zone/Slab-specific, not a general witness bug

  • The exact same payload shape (elementId + inIndex only) works reliably and repeatedly on Wall, Line, and Polyline elements.
  • A manually-drawn dimension (native ArchiCAD dimension tool, snapped to a wall corner where two walls meet) resolves to the walls' real footprint corner (not the reference-line endpoint) — proving ArchiCAD itself can address that corner internally — but GetDimensionData does not expose the underlying witness parameters used, so this couldn't be reverse-engineered from an existing working dimension.
  • On the same wall used in that manually-drawn dimension, testing inIndex values up to 12 still only resolves for 1 and 2 (the reference-line endpoints) — never the real footprint corner.

Expected behavior

Either: witness points should resolve for Zone/Slab elements the same way they do for Wall/Line/Polyline (ideally addressing each polygon vertex via inIndex), or the command/docs should clearly state that only certain element types support witness point addressing, and which inIndex/nodeType/etc. values are valid for each.

Issue 2: CreateAssociativeDimensionsOnSection never finds a valid section

Repro steps

  1. In a project with existing Section views (created natively, long before any scripting) and/or new ones created via CreateSections, call CreateAssociativeDimensionsOnSection with preset: "WallCompositeFaces" and a sectionElementId.
  2. Tried as sectionElementId:
    • The elementId returned directly by CreateSections
    • The navigatorItemId of the matching SectionItem found via GetNavigatorItemTree
    • The databaseId returned by GetDatabaseIdFromNavigatorItemId for that navigator item
    • The elementId of every CutPlane-type element returned by GetElementsByType("CutPlane") (7 sections in the test file, including natively pre-existing ones)
  3. All of the above return: {"error": {"code": -2130313112, "message": "The referenced 'sectionElementId' is not a valid section element."}}

Expected behavior

At least one of these four natural ID candidates should be accepted as a valid sectionElementId, given GetElementsByType("CutPlane") explicitly lists CutPlane as one of its supported enum values.

Environment

  • Archicad 29
  • Tapir add-on 1.5.5
  • Windows
0 Replies 0

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!