Dimension horizontal curtain grid?

Hi guys,
I want to dimension horizontal curtain grid on curtain wall.
I used “Dimension By Reference” Node but only dimension Vertical Curtain Grid.
I understand this node use reference of curtain wall to dimension. But only Vertical Curtain Grid
So, how can i dimension horizontal curtain grid ?
Thank you.

Hey,

So this is my go, just by digging around in the Custom Node and the API…

The node uses GetVGridLineIds… I used U instead http://www.revitapidocs.com/2018/d3bdb700-0cdd-c7c4-e33f-04424c3f03a6.htm

Then to get the edges, I needed the faces which were either up or down, ie. their faces normals were 0,0,1 or 0,0,-1

#Based on a script of maciek.glowka : http://lubim.co
#Thanks to Alban @GeniusLoci !

import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

walls = UnwrapElement(IN[0])
if not hasattr(walls, '__iter__'):
    walls = [walls]

#def isParallel(v1,v2):
#	return v1.CrossProduct(v2).IsAlmostEqualTo(XYZ(0,0,0))

for wall in walls:
	line = wall.Location.Curve
	lineDir = line.GetEndPoint(1) - line.GetEndPoint(0)

	doc=wall.Document
	
refArray = ReferenceArray()
options = Options()
options.ComputeReferences = True
options.IncludeNonVisibleObjects = True
geoElement = wall.get_Geometry(options)
#get side references
for obj in geoElement:
	if isinstance(obj,Solid):
		for f in obj.Faces:
			faceNormal = f.FaceNormal.Normalize()
#			if isParallel(faceNormal,lineDir):
			if faceNormal.IsAlmostEqualTo(XYZ(0,0,1)) or faceNormal.IsAlmostEqualTo(XYZ(0,0,-1)):
				refArray.Append(f.Reference)
    
#get grid references
#for id in wall.CurtainGrid.GetVGridLineIds():
for id in wall.CurtainGrid.GetUGridLineIds():
	gridLine = doc.GetElement(id)
	gridGeo = gridLine.get_Geometry(options)
	for obj in gridGeo:
		if isinstance(obj,Line):
			refArray.Append(obj.Reference)

OUT = refArray

Hope that’s useful!

Mark

1 Like

Hi @Mark.Ackerley
Thank you very much for your post.
I don’t have knowledge about Python, API…
I ever study about Python and API but i don’t understand about them :smiley:
Thank you again.

1 Like