Force select remove constraints option


Is there any way to avoid this dialog box popping up or automatically using python to select the remove constraints option?

Many of the families I background-open have constraints issues.

remove constraints

istcat = toList(UnwrapElement(IN[0]))			
#make filter			
lstbipCat = [System.Enum.ToObject(BuiltInCategory, x.Id.IntegerValue) for x in listcat]			
filtercat = ElementMulticategoryFilter(List[BuiltInCategory](lstbipCat))
fecSymb = FilteredElementCollector(doc).WherePasses(filtercat).WhereElementIsElementType().ToElements()   

for symb in fecSymb:

    	fam = symb.Family
    		famDoc = doc.EditFamily(fam)	
    		if not famDoc.PathName:
    			path = ("Family location not found")
    			path = (str(famDoc.PathName))
    		path = ("This is a system family")

Edit: Added Filtered Element Collector code snippit

Would this Revit API method work? How could you implement this in python.

I’m not that familiar with doing anything with Revit UI from Dynamo, but I would look into the UI events of the Revit API since you wan’t Dynamo to act on something.

I would say that this would be worth looking into.

You should be able to acces this by typing the following in python

from Autodesk.Revit.UI.Events import *

I’m not sure how to use this however, since (for what it looks like to me) Dynamo pauses when a pop-up comes up.
This might actually be easier to fix by writing a python auto clicker script instead of trying to solve it with Dynamo :sweat_smile: