Force select remove constraints option

Hi,

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))
#collector
fecSymb = FilteredElementCollector(doc).WherePasses(filtercat).WhereElementIsElementType().ToElements()   

for symb in fecSymb:

    	fam = symb.Family
    	try:
    		famDoc = doc.EditFamily(fam)	
    		if not famDoc.PathName:
    			path = ("Family location not found")
    		else:
    			path = (str(famDoc.PathName))
    			famDoc.Close(False)
    	except:
    		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.

https://www.revitapidocs.com/2020/b14f8805-cfa4-516e-1873-b284f82770d9.htm

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.

https://www.revitapidocs.com/2020/43d9c4d8-fdb1-a4b2-bdc2-6eaff0f595f3.htm

I would say that this would be worth looking into.

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

clr.AddReference("RevitAPIUI")
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: