Hi,
I wonder if there is a way to get unique id for bRepBody objects?
I have design with bodies with the same name, but one is mirrored so they give different meshes in output.
Swig objects are not hashable so this method won't work.
Unfortunately, there isn't anything currently available like this. This is a recognized issue and something we're working on but I don't know yet when it will be available. Currently, the names are the best thing to identify a body but as you've found, they're not guaranteed to be unique.
Hi Brian,
Is there anything new with unique id for fusion API objects? In my current project I am creating script based on information in Fusion 360 and I need to reference fusion objects with a unique identifier.
I have come up with a half solution to include "ID" attributes on objects that support attributes, but that does not cover all the objects I am working with.
Could you please give me info about the status of unique Ids? Is there a plan to implement it?
Thank you for your answer in advance!
The thing we were working on was attributes, which is now supported. The API does not support ID's for entities. It's been discussed but is not currently on the road map.
I'm curious about your statement that attributes doesn't provide cover for all of the objects you're interested in. What objects do you want that aren't supported?
During my investigation I have found, that for example adsk::core::Profile does not have attributes. 2 days ago I managed to figure out that I am supposed to retrieve the parent objects in case of Profile, SketchLine, SketchPoint, etc. in order to get the actual object that has the name text displayed on the UI. I have not found missing attributes in case of "Parent" objects.
If I understand you correctly, than you support adding IDs to attributes manually by developers. Am I correct?
As a connected question: Is there any built-in or "best practice" way to force objects into ID creation upon object creation?
Thank you for your answer in advance!
My understanding is that Profiles aren't remembered by Fusion either and are recalculated as-needed. Because they're not something that's saved, they don't support attributes.
Your understanding of what I said is correct. You're essentially using attributes to "name" the entities you care about so you can find them later. There isn't any way to automatically do this.
I have bumped into an object type that are remembered by fusion, but does not have attributes: Material.
During my development I need to handle materials by ID as well.
Could you please help me how could I solve the missing ID issue in case of materials?
Materials are a bit of an oddball. They aren't actually a Fusion object because they're stored externally in .adsk files. You're right that it isn't possible to add attributes to materials. The best you can do with materials is to store the id and then use the id to find the material again.
Hello All,
Just wondering if there's way to get ID for bodies. Thank you.
It is a good idea to use an entityToken.