0

My Goal is to have a DWG file converted to be usable in the Forge Viewer and have markup. In the process of getting all the right files for using offline viewer I am trying to get the manifest and metadata for the file. I want the metadata so that I can get access to polygon ids for markup. when I make the call to the metadata it comes up empty. What am I doing wrong?

I have uploaded and sent a SVF conversion job request on a DWG file.

Convert File String
{"input":{"urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn"},"output":{"formats":[{"type":"svf","views":["2d","3d"]}]}}
HTTP/1.1 201 Created
Result{"result":"created","urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn","acceptedJobs":{"output":{"formats":[{"type":"svf","views":["2d","3d"]}]}}}
getManifest
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/manifest
HTTP/1.1 200 OK
Result{"type":"manifest","hasThumbnail":"true","status":"success","progress":"complete","region":"US","urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn","derivatives":[{"name":"Floor_Plan_Sample.dwg","hasThumbnail":"true","status":"success","progress":"complete","outputType":"svf","children":[{"type":"geometry","role":"2d","name":"2D Views","status":"success","progress":"complete","hasThumbnail":"true","children":[{"type":"resource","mime":"image/png","resolution":[100,56],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Model_100.png"},{"type":"resource","mime":"image/png","resolution":[200,113],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Model_200.png"},{"type":"resource","mime":"image/png","resolution":[400,226],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Model_400.png"},{"type":"resource","mime":"application/autodesk-f2d","role":"graphics","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/535e6d00-3822-110e-c53e-4df9301ee4c2_f2d/primaryGraphics.f2d"},{"type":"view","role":"2d","name":"Initial","viewbox":[-0.198947,2.65155,6.826102,5.357447]},{"type":"view","role":"2d","name":"1","viewbox":[1.753343,4.41829,5.463574,6.340082]}]},{"type":"geometry","role":"2d","name":"Layout1","status":"success","progress":"complete","hasThumbnail":"true","children":[{"type":"resource","mime":"image/png","resolution":[100,77],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Layout1_100.png"},{"type":"resource","mime":"image/png","resolution":[200,154],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Layout1_200.png"},{"type":"resource","mime":"image/png","resolution":[400,308],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Layout1_400.png"},{"type":"resource","mime":"application/autodesk-f2d","role":"graphics","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/8fcb06e4-ab26-a304-62c0-7cf8f5ef0470_f2d/primaryGraphics.f2d"}]}]}]}
getMetadata
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/metadata
HTTP/1.1 200 OK
Result{"data":{"type":"metadata","metadata":[]}}

Note that using the node.js extractor example it works fine for the same file and extractor creates a manifest.json.gz and metadata.json.gz . I just want to understand how those where created and with which REST calls.

Greg Bluntzer
  • 323
  • 1
  • 4
  • 21

1 Answers1

1

Unfortunately the model derivative API does NOT support yet metadata for 2D documents, such as .dwg. We are working on providing this feature in an upcoming version of the API.

For the time being I guess the only workaround is to download the package and "reverse engineer" the content. You can take a look at my NPM package download method implementation, this is still using the v1 API but is fully working. This should give you a good idea on how to download an svf resource.

Felipe
  • 4,325
  • 1
  • 14
  • 19
  • Thanks Philippe. When you say "download the package" what are you referring to? Are you talking about the zip file that come from the extractor or is there a single REST api call that I can make that will give me everything associated to the converted file in a package(zip)? – Greg Bluntzer Jul 20 '16 at 17:18
  • No unfortunately there isn't a single REST call because that API isn't designed to provide a download feature, it is intended to be loaded in the viewer, however my NPM package "download" method makes it very easy to download zip locally, it's a single method call. It basically reverses what the viewer is doing when loading a URN, instead of loading the files in the browser, it saves on disk. We do not provide APIs to read or modify those files locally, but it perfectly fine to do so. It's just undocumented and we do not guarantee the svf format remains identical forever in the future ... – Felipe Jul 22 '16 at 09:10
  • Philippe Leefsma. On your extractor program when it gets all the files, can you tell me the origin of the .sb and bin files. I can not figure out how you are getting them. Examples for a rvt file that I extracted are in a folder Resource\3D_View\_3D_\0.pf...6pf, CameraDefinitions.bin. I do not see them mentioned in the manifest json that I get. – Greg Bluntzer Jul 29 '16 at 20:57
  • Are you talking about the npm package at https://github.com/Developer-Autodesk/view-and-data-npm? You can take a look at the source code of the is package (1 file) and put traces there. Take a look at the download method (https://github.com/Developer-Autodesk/view-and-data-npm/blob/master/view-and-data.js#L813). This is a several steps process: 1/ parse the viewable data, 2/ download first set of items, 3/ parse manifest we obtained, 4/ download second set of items. I don't know which item is downloaded when exactly but by putting logs and running the test you should find out easily. Good luck – Felipe Aug 02 '16 at 15:39
  • Hi @PhilippeLeefsma, Sorry to bring up this thread again. Is the API still do not support metadata for .DWG files? I know this answer is little old, but would like to know, anything has changed? – Thangadurai Sep 14 '17 at 09:28