Breaking Changes in Autodesk Platform Services Viewer v7.98: What You Need to Know
Image by Amerey - hkhazo.biz.id

Breaking Changes in Autodesk Platform Services Viewer v7.98: What You Need to Know

Posted on

Autodesk Platform Services Viewer v7.98 has arrived, and with it, some crucial changes that may impact your workflows. One of the most significant changes is the behavior of the NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) methods. In this article, we’ll dive deep into what these changes mean for you and provide step-by-step instructions on how to adapt to the new functionality.

The Old Way: Clearing Isolation with NOP_VIEWER.isolate()

In previous versions of the Autodesk Platform Services Viewer, calling NOP_VIEWER.isolate() or NOP_VIEWER.isolate(null) would clear the current isolation, allowing you to reset the viewer to its default state. This was a convenient way to remove any active isolations and start fresh.

NOP_VIEWER.isolate(); // or NOP_VIEWER.isolate(null)

The Problem: Unintended Consequences

However, this functionality had an unintended consequence. When NOP_VIEWER.isolate() or NOP_VIEWER.isolate(null) was called, it would not only clear the isolation but also reset the viewer’s selection, potentially leading to unexpected behavior and data loss. This was especially problematic when working with complex models and intricate workflows.

The New Way: NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) No Longer Clear Isolation

In Autodesk Platform Services Viewer v7.98, the behavior of NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) has changed. These methods no longer clear the current isolation. Instead, they will simply return the viewer to its default isolation state without affecting the selection.

NOP_VIEWER.isolate(); // or NOP_VIEWER.isolate(null)
// No longer clears isolation, only returns to default state

The Benefits: Improved Stability and Predictability

This change may seem daunting at first, but it brings several benefits. By separating the isolation and selection mechanisms, the viewer becomes more stable and predictable. You can now manage isolations and selections independently, reducing the risk of data loss and unexpected behavior.

Best Practices for Working with NOP_VIEWER.isolate()

To adapt to this change, follow these best practices:

  • Use NOP_VIEWER.isolate() wisely**: Only use NOP_VIEWER.isolate() when you intend to return the viewer to its default isolation state, without affecting the selection.
  • Use NOP_VIEWER.setSelectedNodes() instead**: When you need to clear the selection, use NOP_VIEWER.setSelectedNodes() with an empty array to remove all selected nodes.
  • Manage isolations and selections separately**: Keep in mind that isolations and selections are now independent, and manage them accordingly to avoid unexpected behavior.

Workarounds for Common Scenarios

In some cases, you may need to adapt your workflows to accommodate the new behavior of NOP_VIEWER.isolate(). Here are some workarounds for common scenarios:

Clearing Isolation and Selection

If you need to clear both the isolation and selection, use the following code:

NOP_VIEWER.isolate(); // Return to default isolation state
NOP_VIEWER.setSelectedNodes([]); // Clear selection

Resetting the Viewer to Its Initial State

To reset the viewer to its initial state, including isolation and selection, use:

NOP_VIEWER.isolate(); // Return to default isolation state
NOP_VIEWER.setSelectedNodes([]); // Clear selection
NOP_VIEWER fit(); // Fit the model to the viewer

Migrating to Autodesk Platform Services Viewer v7.98

If you’re planning to migrate to Autodesk Platform Services Viewer v7.98, take the following steps:

  1. Review your code**: Identify areas where you’re using NOP_VIEWER.isolate() or NOP_VIEWER.isolate(null) and assess the potential impact of the change.
  2. Update your workflows**: Adapt your workflows to accommodate the new behavior of NOP_VIEWER.isolate(), using the best practices and workarounds outlined above.
  3. Test thoroughly**: Test your updated code and workflows extensively to ensure they function as expected in Autodesk Platform Services Viewer v7.98.

Conclusion

The changes to NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) in Autodesk Platform Services Viewer v7.98 may require some adjustments, but they bring improved stability and predictability to your workflows. By following the best practices and workarounds outlined in this article, you’ll be well-equipped to adapt to the new functionality and take advantage of the benefits it offers.

Method Description
NOP_VIEWER.isolate() Returns the viewer to its default isolation state, without affecting the selection.
NOP_VIEWER.isolate(null) Same behavior as NOP_VIEWER.isolate()
NOP_VIEWER.setSelectedNodes() Sets the selection to the specified nodes. Can be used to clear the selection by passing an empty array.

By understanding the changes to NOP_VIEWER.isolate() and adapting to the new functionality, you’ll be able to take full advantage of Autodesk Platform Services Viewer v7.98 and create more efficient, predictable, and stable workflows.

Frequently Asked Questions

Get the scoop on the latest updates to Autodesk Platform Services Viewer v7.98 and what it means for NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null)!

Why did NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) stop clearing isolation in Autodesk Platform Services Viewer v7.98?

This change was made to improve performance and reduce overhead. In v7.98, the NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) methods no longer clear isolation automatically, allowing for more control over the isolation process and reducing unnecessary overhead.

What does this change mean for my application?

You may need to update your code to manually clear isolation when necessary. This change gives you more control over the isolation process, but also requires you to take explicit action to clear isolation when needed. Review your code and adjust as necessary to ensure correct behavior.

How do I clear isolation manually in Autodesk Platform Services Viewer v7.98?

You can clear isolation manually by calling NOP_VIEWER.clearIsolation() after calling NOP_VIEWER.isolate() or NOP_VIEWER.isolate(null). This ensures that isolation is properly cleared when needed, giving you more control over the process.

Is this change specific to NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null), or does it affect other methods as well?

This change is specific to NOP_VIEWER.isolate() and NOP_VIEWER.isolate(null) methods. Other methods in the Autodesk Platform Services Viewer v7.98 API are not affected by this change.

What if I’m still using an older version of the Autodesk Platform Services Viewer?

If you’re using an older version of the Autodesk Platform Services Viewer, you won’t be affected by this change. However, we recommend upgrading to the latest version (v7.98) to take advantage of the improved performance and new features.

Leave a Reply

Your email address will not be published. Required fields are marked *