02-10-2022 07:56 AM
What's the preferred way to check if a dynamic wire is carrying a specific object type (excluding descendants)?
At the moment I'm using the built-in "Get LV Class Name" function and a string comparison to see if the two values match. However, string comparison in this situation just feels wrong.
Solved! Go to Solution.
02-10-2022 09:32 AM
Wire the class through a for loop with the count set to 0 - this will return a default instance of the wired class. Then, check that value against the class constant.
02-10-2022 10:08 AM - edited 02-10-2022 10:09 AM
That's an elegant solution for getting a class' default value that I wasn't aware of. I thought it was going to fail on upcast/more generic wires, but it still works.
Thanks