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

Hi @alikhan.ganayev.  Actually, that second error message is telling us that the error is happening at the point we are attempting to set a new name to a ComponentOccurrence, so that is at least something.  The most likely reason that this is failing, is that the name you are attempting to assign to the component is already being used by another component, and it won't allow two components to be named identically.  So basically, it starts processing those components at the start, but there may be a component later in the list that already has the name you are trying to assign to a component earlier in the list.  Does that make sense to you?

 

Oh...and another thing that may help this process make more sense is that when using a For Each loop like that, it will most likely start processing those items within, starting with the ones which were first 'placed' into the assembly, not necessarily in alphabetical order by their names.  It's the same as when using the For I = 1 To oCount, then using Item(I) within...the Item index is generally determined by which ones in the group existed first, to which ones came into existence last.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)