Hi all, I’m super green to Dynamo and Python. This is graph where I attempt to filter out non-PressureFittings. Didn’t get far since my If/else condition isn’t failing successfully. I get an error that I assume is coming from the Pass statement. Prob something stupid simple I overlooked. Thanks for looking.
That is meant to cause the condition to fail or skip to the else: which isn’t happening. Am i right that “Pass” is causing the issue?
Are you trying to get it to output false?
if you are, just swap these bits
Currently… it can’t find PressureFitti … it’s an object that doesn’t exist
These are identical scripts except that PressureFitting portion. If the selection is not a PressureFitting type shouldn’t the condition fail and go to else: ?
No because it’s looking for an object… It can’t find that object so it’s giving you an error rather than going to the next bit of your code and outputting False.
Also, the pass doesn’t seem to be doing anything… I’d remove it.
I see what you mean but i think the function is checking the Type, not an instance of the type…yes? And so Pass isnt doing anything because its open for Read?
As I read it, you’re asking it to do something it doesn’t understand (because Pressurefitt doesn’t exist) … so it’s confused and throws and error.
Pass is after commit… so I can’t see the point of it.
@Nick_Boyts is better at Python so he’ll probably be able to give you a far better answer than me ![]()
I’m going to do what you say and figure out a diff way how to test a Fail. Sure appreciate you looking at this and commenting so soon. ![]()
Either swap the bits as I suggested (so it’ll output False) or try adding a not >>
if not isinstance(aeccObj, PressureFitting ):
You were right from the start. It was looking for the instances’ type which didn’t exist. Didn’t realize that the func would fail if it couldn’t find the type though. But yeah, its working now. Picked a pipe and it failed properly. Thanks again!!


