Hello Vitalii,
even though I use the IsEntityValidCallback as you describe above, I always check during runtime if I'm working with the correct object type by adding an
if isinstance()
check in front of those code blocks. Just want to make sure that I don't run into any runtime errors.
Especially with the memberselection, since you can have none matching entities selected before you start the macro.
You can use the isinstance i.e.
self.lType = clr.GetClrType(IPolyseg)
if isinstance(o, self.lType)
# or
if isinstance(boundarysite, PlanSetSheetViews) or \
isinstance(boundarysite, PlanSetSheetView) or \
isinstance(boundarysite, SheetSet) or \
isinstance(boundarysite, BasicSheet):
# or
if isinstance(v, clr.GetClrType(Hoops2dView))
I usually use it without the "clr.GetClrType" and it works.