0

We would like to remove existing properties for a selected object and display custom properties we have imported in a JSON object. We attempted to implement removeAllProperties() listed in the viewer API documentation here .

enter image description here

However, when implemented the properties panel still displayed existing properties. Are we misunderstanding the intended implementation of this call?

What would be the recommended method for removing all properties so that we can display custom properties from the JSON data imported?

2 Answers2

0

removeAllProperties() does work. The mistake I made was that it must be called in reference to a properties panel. We had just used it with no reference to a properties panel.

i.e. what worked for me...

_panel.removeAllProperties()

because _panel had been previously defined

Autodesk.ADN.Viewing.Extension.MetaPropertyPanel = function (viewer) {

var _panel = this;

This removed all the properties for the selected item an allowed us a clear properties panel for showing our custom data.

Hooray!

0

That method is exposed on the PropertyPanel entity. See for detailed usage and working on custom properties here and here:

viewer.getPropertyPanel(true).removeAllProperties()

Live Demo: https://jsfiddle.net/dukedhx/bv1arxe4/

Bryan Huang
  • 5,247
  • 2
  • 15
  • 20