Hi, Is there a way to use dynamo/ python to get in to the assembly edit mode?
PS. My ultimate goal is to work around the fact that each time you modify one assemblyinstance a new assembly is created, but you really want the assemblytype to be modified.
I always thought that process should have an option as you close out the assembly edit. Users selects to create new assembly or edit existing assembly. ----- i also need to change thesiplay colors to the edit mode, its rough.
Pick assembly to Edit
-remember “Original” Type and select all instances of type - selected assembly
-edit assembly -->Through normal process, let revit change assembly type**(need help here)
-Pick new “Updated” assembly Type
-Update Assembly types of “Original” Assembly Instance
-Rename assembly type to original name.
putting in time to achive this, but would be best to change the setting of the assembly eedit mode.
With dynamo the actions needed is to pick element selections. Dynamo should do the rest.
the only issue im having is waiting for user input to complete edit.
ill post what i got tonight
Don’t like the excel pooping up, only way i found to remember instances - will work on a Datashape dialogue also to make it smoother. It does the job specially with the amount of assembly to update. Tried Selecting all instances in revit to replace, but its not reliable. Can We make it![update assembly|690x389]
Here is the python code to close the excel sheet (it probably could do with some code cleanup, but it works):
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
sheetName= IN[0]
Run=IN[1]
import sys
import System
from System import Array
from System.Collections.Generic import *
clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c')
from Microsoft.Office.Interop import Excel
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo("en-US")
from System.Runtime.InteropServices import Marshal
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
from os import path
def ExitExcel(xlApp, wb, ws):
# clean up before exiting excel, if any COM object remains
# unreleased then excel crashes on open following time
def CleanUp(_list):
if isinstance(_list, list):
for i in _list:
Marshal.ReleaseComObject(i)
else:
Marshal.ReleaseComObject(_list)
return None
xlApp.ActiveWorkbook.Close(True)
xlApp.ScreenUpdating = True
CleanUp([ws,wb,xlApp])
return None
if Run:
xlApp = Marshal.GetActiveObject("Excel.Application")
wb = xlApp.ActiveWorkbook
ws = xlApp.ActiveSheet
# get worksheet
if sheetName == None:
ws = xlApp.ActiveSheet
ExitExcel(xlApp, wb, ws)
#Assign your output to the OUT variable.
OUT = 0
That works great, I had not renamed to original name on mine yet, thanks for the reminder. i used bumble bee in the Gif to avoid the excel also. This will really help in the workflow. although im expecting some errors, when assembly is mirrored or rotated. Let me know if you see any Wuil@wmedrano.com i will add it to my repository here https://www.dropbox.com/sh/qmkppzyfr3vpzcc/AACixFKnMC84FhgjppsDvy5la?dl=0
List in the picture is a list of nested elements of assembly members. And I try to add them to assembly but it doesn’t work also if I replace them with “select model elements”