Dimensioning Curtain Wall Grid in Linked Model


#1

I am trying to compose a Dynamo graph to do dimension of Curtain Wall Grids in Linked Model, however, it turn out an error “The references are not geometric references”.


I use the same graph for a Curtain Wall in main model (not on the Linked Model), it result turn out fine.
Then I try to think what the difference, then I composed a inspection tool to the dimension, then I discovered that the references of dimension on the main model able to be recognised as Curtain Wall Grids and Wall.

Then I did a manual dimension to see the references of dimension for Linked Model, it turn out all are RevitLinkedInstance.

Based on what it shown, it seems there is another layer data in the main model while trying to access the elements in Linked Model, which may not be ready in the current Dynamo version.

My questions, is it possible to do the dimensioning in main model for elements exist in Linked Model? I included my Work-in-progress dynamo graph and Revit model files for reference.
(WIP)Dimension Linked Model Curtain Grids in Plan View.dyn (201.5 KB)
SampleLinkedModel_CurtainWall.rvt (356 KB)
SampleMainModel_CurtainWall.rvt (368 KB)


#2

Hi @Mike_Chan,

I don’t think it is possible. It is working fine with the curtain wall in the current document.
With the linked curtain wall, I have this error : “Exception: Invalid number of references.” which is not a good news.



#3

You have to do some tricks with linked references.

I coudn’t open your dynamo definition but something like that worked for me:

#get grid references
for id in wall.CurtainGrid.GetVGridLineIds():
	objectDoc = wall.Document
	gridLine = objectDoc.GetElement(id)
	gridGeo = gridLine.get_Geometry(options)
	for obj in gridGeo:
		if isinstance(obj,Line):
			linkedReference = obj.Reference.CreateLinkReference(linkedInstance)
			reps = linkedReference.ConvertToStableRepresentation(doc).split(':')
			
			res = ''
			first=True
				
			for s in reps:
				t = s
				if "RVTLINK" in s:
					if res.endswith(":0"):
						t = "RVTLINK"
					else:
						t = "0:RVTLINK"
				if not first:
					res = res + ":" + t
				else:
					res = t
					first = False
						
			ref = Reference.ParseFromStableRepresentation(doc,res)
			refArray.Append(ref)

I’ve adapted this to python- https://forums.autodesk.com/t5/revit-api-forum/create-dimensions-for-familyinstance-in-linked-file/td-p/8424237