Inconsistent Dimension Reference in Revit API - Sometimes Shows FamilySymbol Instead of Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm facing an issue with a Revit API script I've written to automate the dimensioning of foundation and column instances visible in the current view. The script generates the dimensions and retrieves their IDs, but the dimensions are sometimes not visible in the view. When I inspect the referenced element ID of the dimensions, it occasionally shows the reference type as FamilySymbol instead of the instance of the foundation or column.
Algorithm I followed:
- Retrieve Visible Elements: I get all visible foundation and column instances from the current view.
- Get Vertical Faces: For each element, I retrieve the vertical faces and group two opposite faces.
- Create References: I gather references from these faces and add them to a ReferenceArray.
- Create Dimensions: I create the dimensions using this ReferenceArray.
The issue is inconsistent. Sometimes the dimensions work as expected, with correct references to the instances, and other times they don't, with the references incorrectly pointing to the FamilySymbol.
I suspect this may be due to how I am capturing or applying the face references, but I haven't pinpointed the exact cause.
Has anyone encountered similar behavior or have suggestions on how to resolve this inconsistency?
Thanks in advance for your help!