Assembly edit mode

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.

Thanks for any help/ suggestions

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.

i started with this outline work around

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.

Hi @gerstal82,

The Clockwork package has some nodes for removing(old) and adding(new) elements.

I’m not sure if this is what you are after, but maybe it can be of help.

Kind regards,

I use the same method as you mentioned, but if you have to modify about 100 assemblies it takes too much time.

I will look in to that, thanks.

With kind regards,

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]

this gif is cleaner, it still a few more clicks than desired, but it make the task smoother.


Thanks for sharing the info.

I Modified the graph a bit, I also found a way to close the excel file from a node of the bumblebee package

  1. play the first script: write all assembly instances and names in an excel sheet

  2. Modify the assembly ( which results in a new assembly

  3. play the second scipt: it updates the other assemblies by reading the excel sheet and renames, the updated assemblies to the old name

Here is the python code to close the excel sheet (it probably could do with some code cleanup, but it works):

import clr
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]
import sys
import System
from System import Array
from System.Collections.Generic import *

    clr.AddReferenceByName('Microsoft.Office.Interop.Excel, Version=, 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'

    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:
    		return None
    	xlApp.ScreenUpdating = True
    	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 i will add it to my repository here

1 Like

Hi! I can’t add any members to my assembly. It’s doesn’t return any errors but do nothing. Please, help!

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”

Hi @stepanste,

We can’t see what your (assembly) input looks like, is it a nested list ?
Maybe you have to add levels to the “Assembly.AddMembers” node (also see the link below).

Kind regards,

yes! I tried to use different lists out of these elements for “AddMembers” but all the same

si in adding something goes wrong

@stepanste share this image on the post you created earlier, this seems to be a separate issue than this original topic :slight_smile:

Oh, ok!

1 Like

For those who are interested, the story continues here :slight_smile:

1 Like