Is there any API to rename Occurrence object?

Is there any API to rename Occurrence object?

varun_nct
Participant Participant
1,081 Views
2 Replies
Message 1 of 3

Is there any API to rename Occurrence object?

varun_nct
Participant
Participant

Member function "name" of Occurrence class returns the name of the occurrence. There is no setter method for name. 

 

Observed that Component class has member function "name" to set name. So, we used this method on Component of an Occurrence to rename Occurrence. But observed that it renames all it's Occurrences present in document and not the one we selected from Component List on LHS of Fusion 360 View window.

 

Observed same behaviour when used "name" method on nativeObject of an Occurrence then. 

For assemblyContext occurrence the "name" method sets name of the Component in which Occurrence is present.

 

We expect setter method of "name" in Occurrence class to rename a selected Occurrence only and not all Occurrence or it's Component.

0 Likes
Accepted solutions (2)
1,082 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor
Accepted solution

Hi @varun_nct .

 

I think Occurrence.name has the following specification.

<Component.name> : <instance index>

Therefore, I think it is read-only.

0 Likes
Message 3 of 3

BrianEkins
Mentor
Mentor
Accepted solution

@kandennti is correct. Fusion does not support the naming of occurrences and the name is derived from the component the occurrence references.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes