I’m trying to dimension to the finished face of 2 parallel walls.
If I use the walls as the elements in ‘Dimension.ByElements’ it will do it to the centre line. I don’t want to extract curves and dimension to those as the dimension will not be hosted to the actual walls. I though i could get the face references of the walls and use those but I am getting an error:
“Warning: One or more of the input types are not matching. Couldn’t find a version of ByElements that takes arguments of type (Revit.Elements.Views.FloorPlanView,__array,__array,string,string)”
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc=DocumentManager.Instance.CurrentDBDocument
line = UnwrapElement(IN[0]).GeometryCurve
elements= IN[1]
dim=0
elementsRef=ReferenceArray()
opt=Options()
opt.ComputeReferences=True
opt.IncludeNonVisibleObjects=True
opt.View=doc.ActiveView
for element in elements:
elementsRef.Append(element)
TransactionManager.Instance.EnsureInTransaction(doc)
dim= doc.Create.NewDimension(doc.ActiveView, line, elementsRef).ToDSType(True)
TransactionManager.Instance.TransactionTaskDone()
OUT=dim
Looks like the difference between Revit.GeometryReference.ElementFace and Autodesk.Revit.DB.Reference (when converting a wall surface to a reference through the clockwork node did the trick)
But I can’t get the clockwork node to work. I tried both faces (which I think is correct) and also surfaces. Error messgae is:
Warning: One or more of the input types are not matching. Couldn’t find a version of __func_3204925d04934b8bb42bfb0d8041837b that takes arguments of type (__array)
Im running 2018 D1.3.3
My input to the clockwork node had a flattened list of two surfaces displaying as “Surface” in the node preview. Is that what you have in the Face.SurfaceGeometry node?
It would appear that there is a difference between the surface extracted from a geometry and a selected model face. Though they both appear to be Autodesk.DesignScript.Geometry.Surfaces… I will investigate further in the morning.
Hi @Paul_Wintour
The error I was encountering related to remaking the surface from a face, rather than extracting the surface directly.
Try using the Topology.Faces node directly from the wall elements themselves. This will return the wall faces as surfaces. It should work then.
The Python script creating the dimensions has an input of type ‘Autodesk.Revit.DB.Reference’. Do you know how you can extract this from a level and grid?
I believe I can use the ‘GetPlaneReference’ method for levels but not sure about grids. There is a ‘Grid.ElementCurveReference’ but the Python script doesn’t like that.
I want to combine face geometry (landings, risers, etc) with levels/grids to create one dimension string.
Sorry but how would I go about amending this so that it takes a list of lines (3 lines one for each dimension) and 3 lists of elements to be dimensioned?
I thought I could create a custom node and just change the lacing but that doesn’t work. How does lacing working with Python nodes within a custom node? Is this possible or is it best to modify the Python itself?
Thanks
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc=DocumentManager.Instance.CurrentDBDocument
line = IN[0].ToRevitType()
elements= IN[1]
dim=0
elementsRef=ReferenceArray()
opt=Options()
opt.ComputeReferences=True
opt.IncludeNonVisibleObjects=True
opt.View=doc.ActiveView
for element in elements:
elementsRef.Append(element)
TransactionManager.Instance.EnsureInTransaction(doc)
dim= doc.Create.NewDimension(doc.ActiveView, line, elementsRef).ToDSType(True)
TransactionManager.Instance.TransactionTaskDone()
OUT=dim