0

I am working on Autocad using C# so need to know whether there is any way to get flat list of layers from the dwg file (using urn).

Right now I am using "GetModelviewPropertiesAsync" method of Autodesk library, but this is giving me of hierarchical data and it is not efficient to iterate through each loop.

Also tried this api Link. This is also not giving me a flat list.

Please help.

Vishvadeep singh
  • 1,624
  • 1
  • 19
  • 31
Gaurav
  • 122
  • 1
  • 2
  • 11

1 Answers1

1

The Forge Model Derivative APIs only provide the structured properties. Forge Viewer obtains the layers by traversing through the properties (just once) after loading the urn. Is there any reason why you'd need to traverse the properties in a loop?

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • On upload of a CAD file, I am trying to map the layers in the file with layers in my database. All this without loading the urn in the viewer. So I am looking at an AutoCAD API which can return me a list of layers and its properties simply by giving it the urn. The Model derivative API doesn't seem to return. – Gaurav Oct 04 '18 at 07:15
  • The Model Derivative API only returns the properties in a structured form, but I'm wondering what you meant by "it is not efficient to iterate through each loop". You could run the operation (extracting a flat list of layers from the structured properties) just once, after the CAD file is uploaded, and then store the list somewhere for later reuse. – Petr Broz Oct 04 '18 at 08:55