- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create dimension lines between certain parallel geometry faces of a FamilyInstance.
I can find the faces that need to be referenced and get their references for use in the Document.Create.NewDimension method.
If the family is instanced in the top level document then a dimension line is correctly created and displayed.
However, if the family is instanced in a linked file I get the error "Invalid number of references". Which makes sense I guess since the references are valid for the linked document, not for the project document itself and if they are filtered out the NewDimension method is called with an effectively empty array.
Then I tried to use the Reference.CreateLinkReference(RevitLinkInstance) method. According to the documentation this should create a reference in the project document based on the reference from the linked file that can be used for face based families. (the Reference is the geometry reference for a solid face from the familyinstance from a linked file and the RevitLinkInstance is set to the linked file from which that familyinstance was obtained)
Apparently that last part about 'used to create face based' must be taken quite literally because the NewDimension method throws and exception "The references are not geometric references". The ElementReferenceType of the references is set to REFERENCE_TYPE_SURFACE just like it is for FamilyInstances in the project file so whatever is different and prevents these references from being used is hidden in the proxy base class or Reference
It is evidently possible for dimension lines to be created for faces of families from linked files, since it can be done from the GUI. The question is if this is possible from the API and if so, how?
Solved! Go to Solution.