Assembly edit mode


#1

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


#2

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.


#3

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.


#4

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,
Mark


#5

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

@MJB-online,
I will look in to that, thanks.

With kind regards,
Gerard


#6

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


#7

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]


#8

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


#9

@Wuillian_Medrano

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
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

#10

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


#11

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”


#12

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).
https://forum.dynamobim.com/t/add-members-to-multiple-assemblies/9626

Kind regards,
Mark


#13

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

si in adding something goes wrong


#14

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


#15

Oh, ok!


#16

For those who are interested, the story continues here :slight_smile:
https://forum.dynamobim.com/t/add-subcomponents-to-assembly-with-assembly-addmembers/18917