Script Python API: scene.findDuplicatedPartOccurrences

I am currently developing scripts using the Pixyz Studio 2025.1 Python API, and I am specifically working on identifying and processing geometrically duplicated or similar Part Occurrences within a scene.

In the API documentation, I found the scene.findDuplicatedPartOccurrences function, which appears highly relevant to this task.

Based on my observations, it seems that the function returns a list containing only one representative Occurrence ID for each pair or group of duplicated occurrences, rather than returning the IDs of all the occurrences within those groups.

For instance, if there are 4 pairs of duplicated objects in the scene (meaning a total of 8 occurrences are duplicated across these 4 groups), the findDuplicatedPartOccurrences function appears to return a list containing only 4 Occurrence IDs (one ID from each duplicated pair/group). My objective is to obtain the IDs of all 8 duplicated occurrences.

Therefore, I would be very grateful if you could provide clarification on the following:

  1. Could you please confirm if the observed behavior is correct?
    Does scene.findDuplicatedPartOccurrences indeed return only one representative Occurrence ID per duplicated pair or group?
  2. If this is the intended behavior, could you please advise on how I can programmatically obtain the IDs of all occurrences within the duplicated pairs or groups using the Pixyz Studio 2025.1 Python API?

Thank you very much for your time and assistance.

From what I understand, scene.findDuplicatedPartOccurrences will only find objects that are literally on top of each other with the same polycount etc. depending of course on the settings you enter (e.g. AABB distance).

Also, when testing just with cubes that I duplice and then “make unique”, I can also see that not all cubes are selected, although they are all complete duplicates so I think there is a bug in the function or I also do not understand the mechanism.

Anyway! -
I think if you are looking for similarity, use pxz.algo.findSimilarPartOccurrencesFast() as this will only look for nearly same polycount and size and it will then select all similar objects as you are also looking to do.

Additionally, If your data comes already imported from CAD and has Instances already included (see prototyping in Pixyz Studio), then you can also get those instances.

edit
For clarification, I also created a bug ticket for the duplicate-function. ticket #2287269

1 Like