Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: Preston_Reed

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

EESignature

(Not an Autodesk Employee)