Search code examples
autodesk-forgeautodesk-viewerautodesk-model-derivative

Regarding consistency of fragid in modelderivative API


I saw the following thread.So I wondered what fragid was like.

What is the best way to persist a reference to an item in forge viewer?

Is fragid guaranteed to be the same across model versions / conversions? Or isn't it as guaranteed as dbid? I am experimenting with an actual model, but I am not sure. Do you know the answer?


Solution

  • Neither dbIDs nor fragIDs can be used for consistent references across design versions.

    • dbIDs are sequential IDs of "design elements"; they're unique within a model, but are not guaranteed to be consistent across different versions of your design
    • fragIDs are internal IDs of "fragments"; a fragment is a piece of geometry with specific transformation and material; a design element can typically consist of one or more fragments

    As explained in the linked thread, the right way to get object references that are consistent across design versions is to query each object's properties (for example, using the getProperties API), and look for the "external" property.