Message 1 of 6
Knowing if an object has Custom Attributes

Not applicable
01-07-2011
03:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've been having this problem at my job where I need to go through a scene's objects and check if they have a custom attribute on them. Whenever you try to access one of the C.A properties of an object that has no C.A applied , it returns an error.
Thus the solution for now is to do a try()catch(). But on a large group of objects , the UI (dotnet) becomes slow because of that check. When I did put that checkup part under comments,
the process was much faster.
So the question is: Is there a way to ask to an object if it has been assigned with a specified custom attribute. Returning a true / false , an empty list or whatever! As long as it's not an error!
Thanks in advance!
I've been having this problem at my job where I need to go through a scene's objects and check if they have a custom attribute on them. Whenever you try to access one of the C.A properties of an object that has no C.A applied , it returns an error.
Thus the solution for now is to do a try()catch(). But on a large group of objects , the UI (dotnet) becomes slow because of that check. When I did put that checkup part under comments,
the process was much faster.
So the question is: Is there a way to ask to an object if it has been assigned with a specified custom attribute. Returning a true / false , an empty list or whatever! As long as it's not an error!
Thanks in advance!