Hello,
I manually created an assembly in Rhino using Rhino’s UI (“Modify” tab->Create Assembly).
And then I would like to create a new assembly instance with Python node, by using PlaceInstance method.
It works without issues, however, every time I run the Python node, the following dialog box appears at PlaceInstance
method line:
Is this normal behavior of this method?
Is there a way to suppress this dialog box?
I would be grateful for any kind of help.
Attached are files. I am using Revit 2019.2, Dynamo 2.0.2.68, and IronPython2 engine.
assembly_instance.rvt (1.0 MB)
assembly_instance.dyn (5.6 KB)
This is the source code:
# load libraries
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
# inputs
assName = 'assemblyProba2'
insertPt = XYZ(50,0,0)
if IN[0]:
# a) get all assembly instances
elColl = FilteredElementCollector(doc) \
.OfClass( clr.GetClrType(AssemblyInstance) )
elColl.WhereElementIsNotElementType()
assembly_el_L = elColl.ToElements()
# b) take the one with 'assName'
for el in assembly_el_L:
if el.Name == assName:
assemblyType_id = el.GetTypeId()
break
# c) insert assembly instance
with Transaction(doc) as t1:
t1.Start("insert assembly instance")
el_assemblyInstanc = AssemblyInstance.PlaceInstance(doc, assemblyType_id, insertPt)
t1.Commit()
OUT = el_assemblyInstanc