Hey,
I have a simple problem that I cannot seem to get around. I need to select a family type by it’s GUID’s, but it doesn’t seem to be an option in Dynamo.
I export the types, some parameters and their GUID’s to excel, fill in information in excel and bring that back in and populate the parameters with the data. I know I can us element ID’s, but it is a work-sharing enable project and it could be a few days before I get the information back in excel.
Does anyone know of a way to select family types by a GUID?
I did see that @Peter_Kompolschek had a post a while back here:
but I couldn’t see the image clearly due to the forum change (i think)
any help would be great!
Thanks
Neil
Error in syntax of code above in the end- cleared out try/except to catch errors for i…
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
#import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference ("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
#Import Revit API
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stores as a list in the IN variable
dataEngineeringNode = IN
doc = IN[1]
#unwrap incoming info for use with API
guids = UnwrapElement(IN[0])
#use ElementIDs to select elements
elements = []
errors = []
message = None
for i in guids:
try:
elements.append(doc.GetElement(i))
except:
errors.append(i)
pass
#Assign your output to the OUT variable
if len(errors)>0:
OUT = elements,errors
else:
OUT = Elements