Dimensioning Curtain Wall Grid in Linked Model

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.
image
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)

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.


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

4 Likes

Thanks Maciek.glowka for the code, but I cannot make it works. I tried the code you provided here, also tried based on your other post. Both stopped with the same error, saying 'Reference" object has no attribute ‘ConvertToStableRepersentation’. Are you able to offer more tips for accomplishment of the code?

error

Hi,

I cannot check the code with revit now, but one thing that I see is that you have a typo in “representation” (not “repersentation”)…

Thanks for pointing out the typo. However, after fixed the typo, the output is null.


, and I have no idea how to fix it.

Is it possible you upload the dyn file, which is work, for sharing?

thanks in advance

linkedCurtainDim.dyn (4.4 KB)

Hi,
here is a dyn file that seems to be working. I select via node the linked document in the model. Then there is a small helper python node to get the wall from the linked document. Wall object and linkedInstance are finally connected to the python node you’re after.

Hope that works now :slight_smile:

2 Likes

Thanks Maciek, it is a great help. Understanding that the Python Script you given work for single element input. I tried to modify your given script to work for list object, it is kind of working, however, the output list does not structured according to input.
image
is it possible structure the output list according to the input? alike the sample below:
image

You need to create a list of ReferenceArrays. And then for each wall create a separate ReferenceArray and append it to this list.