- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @Preston_Reed. This following line in that Sub you mentioned is definitely not right.
If oOccurrence = "VTHFAB4-MCI:1" Then
...It is not accessing the components '.Name' property, so it is comparing a component object to a String, which throws the error. It should have been like this:
If oOccurrence.Name = "VTHFAB4-MCI:1" Then
As for why certain components causing problems before you introduced that check in there...it may be cause the component represents something like a Content Center part, or maybe it is otherwise ReadOnly for some reason, therefore when you try to change its iProperty, it doesn't like that. Just one possibility.
PS. There are also certain kinds of components that sometimes show up when looping through components that you may not expect, such as a 'virtual' component (for BOM use only), or the welds of a weldment type assembly (yea, there is a component for that, believe it or not).
Wesley Crihfield
(Not an Autodesk Employee)