I was using the Forge AutoDesk Data management, design management and model viewer APIs to upload my .dmg, convert it to svf and then using the metadata. It works well for 3D designs but there seems to no guid inside the metadata when I use 2D designs. Is there something I am doing wrong?
EDIT: I can get the manifest alright, but when I fetch the metadata for the same, it gives an empty array.
{
"type": "manifest",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw",
"version": "1.0",
"derivatives": [
{
"name": "1126.dwg",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"messages": [
{
"type": "warning",
"code": "AutoCAD-MissingReference",
"message": [
"Missing reference\nOne reference was not uploaded so the drawing may not be fully displayed.\n- Please upload the composite design with the missing referenced file: {0}",
"\\\\Aa-6246410c0eaa\\LG(D)\\nitin\\materials\\RCS-9-03\\DSCN9763.JPG"]
}
],
"outputType": "svf",
"children": [
{
"guid": "6882be48-6626-5238-d3df-94e9f0a0019d",
"name": "2D View",
"hasThumbnail": "true",
"role": "2d",
"viewableID": "Model",
"progress": "complete",
"status": "success",
"type": "geometry",
"children": [
{
"guid": "723799fd-39bd-e421-d62e-442878941b21",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
100,
56
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/1126-Model_100.png",
"status": "success",
"type": "resource"
},
{
"guid": "8bd323a6-b1be-26a2-b486-590ea29d51f8",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
200,
113
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/1126-Model_200.png",
"status": "success",
"type": "resource"
},
{
"guid": "7395d92b-3098-ceae-46b9-6e008775b99b",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
400,
226
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/1126-Model_400.png",
"status": "success",
"type": "resource"
},
{
"guid": "ca2b3fe1-6688-21e6-8936-aff2e362caad",
"role": "graphics",
"mime": "application/autodesk-f2d",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/5f187141-7458-ca76-6ed8-405d67eed186_f2d/primaryGraphics.f2d",
"status": "success",
"type": "resource"
}
]
},
{
"guid": "9c7ee634-2c29-0bca-24c4-a43eb97eaf8b",
"name": "Layout1",
"hasThumbnail": "true",
"role": "2d",
"viewableID": "Layout1",
"progress": "complete",
"status": "success",
"type": "geometry",
"children": [
{
"guid": "74b8925c-0a51-00a0-eeef-554c2e12bc2e",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
100,
64
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/1126-Layout1_100.png",
"status": "success",
"type": "resource"
},
{
"guid": "4ffd2d29-9837-fd12-1e97-d21fec6bdf53",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
200,
129
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/1126-Layout1_200.png",
"status": "success",
"type": "resource"
},
{
"guid": "c36ed9e4-4a15-c887-f7b5-f5677533f9d5",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
400,
258
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/1126-Layout1_400.png",
"status": "success",
"type": "resource"
},
{
"guid": "b0683c33-2116-2202-cdf2-2b61684fc432",
"role": "graphics",
"mime": "application/autodesk-f2d",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS8xMTI2LmR3Zw/output/ee27dd79-d97f-be8c-a4c5-aefef3f41fcf_f2d/primaryGraphics.f2d",
"status": "success",
"type": "resource"
}
]
}
]
}
]
}
EDIT 2 In converting some other dwg file, I got this message as a warning in the response body, can this also be a reason I am unable to get the metadata?
{
"type": "manifest",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c",
"version": "1.0",
"derivatives": [
{
"name": "casa2.dwg",
"hasThumbnail": "true",
"status": "success",
"progress": "complete",
"messages": [
{
"type": "warning",
"code": "AutoCAD-MissingReferences",
"message": [
"Missing references\nSome references were not uploaded so the drawing may not be fully displayed.\n- Please upload the composite design with all the missing referenced files: {0}","C:\\Documents and Settings\\Edel II\\Desktop\\094 CASAS HACIENDA LA CONCEPCION\\160 m2\\FACHADA 1.jpg, \\\\SERVIDORBA\\Servidor_BA\\BA\\000 Proyectos\\094 CASAS HACIENDA LA CONCEPCION\\140 m2\\PLANTA ALTA.jpg, \\\\SERVIDORBA\\Servidor_BA\\BA\\000 Proyectos\\094 CASAS HACIENDA LA CONCEPCION\\160 m2\\PLANTA ALTA.jpg, \\\\SERVIDORBA\\Servidor_BA\\BA\\000 Proyectos\\094 CASAS HACIENDA LA CONCEPCION\\160 m2\\PLANTA BAJA.jpg, \\\\SERVIDORBA\\Servidor_BA\\BA\\000 Proyectos\\094 CASAS HACIENDA LA CONCEPCION\\140 m2\\PLANTA BAJA.jpg"
]
}
],
"outputType": "svf",
"children": [
{
"guid": "6882be48-6626-5238-d3df-94e9f0a0019d",
"name": "2D View",
"hasThumbnail": "true",
"role": "2d",
"viewableID": "Model",
"progress": "complete",
"status": "success",
"type": "geometry",
"children": [
{
"guid": "a544946a-154f-0bc4-1dd2-43c67dfc07f6",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
100,
100
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/casa2-Model_100.png",
"status": "success",
"type": "resource"
},
{
"guid": "f277d222-695f-0ff7-2a69-d64eaf68c6f8",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
200,
200
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/casa2-Model_200.png",
"status": "success",
"type": "resource"
},
{
"guid": "4e826d98-15f2-c33d-e466-955e9016ffc4",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
400,
400
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/casa2-Model_400.png",
"status": "success",
"type": "resource"
},
{
"guid": "42aef4c1-c306-07b1-928b-5ae7b60121e9",
"role": "graphics",
"mime": "application/autodesk-f2d",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/d77efc26-d4ab-8843-2499-2b863dedd9b8_f2d/primaryGraphics.f2d",
"status": "success",
"type": "resource"
}
]
},
{
"guid": "9c7ee634-2c29-0bca-24c4-a43eb97eaf8b",
"name": "Layout1",
"hasThumbnail": "true",
"role": "2d",
"viewableID": "Layout1",
"progress": "complete",
"status": "success",
"type": "geometry",
"children": [
{
"guid": "300c4a29-4b14-3be7-72f6-935a8fdf502f",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
100,
100
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/casa2-Layout1_100.png",
"status": "success",
"type": "resource"
},
{
"guid": "9760574f-0493-f082-9cc3-1412a5a15a11",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
200,
200
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/casa2-Layout1_200.png",
"status": "success",
"type": "resource"
},
{
"guid": "565ec6a9-11b5-269c-faf6-e2eb502fd382",
"role": "thumbnail",
"mime": "image/png",
"resolution": [
400,
400
],
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/casa2-Layout1_400.png",
"status": "success",
"type": "resource"
},
{
"guid": "d8ab5cb1-76ea-6fc7-074c-d1c9d68da110",
"role": "graphics",
"mime": "application/autodesk-f2d",
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZGFkYXNkc2FkYS9jYXNhMi5kd2c/output/caa83ac1-64a6-dbd7-8277-03d949efbaf7_f2d/primaryGraphics.f2d",
"status": "success",
"type": "resource"
}
]
}
]
}
]
}
Getting metadata is not yet doable for 2D documents unfortunately. This has been logged as a wish and will be implemented by the development team.
Unfortunately we cannot give you an estimate about it.Sorry for the bad news.
The workarounds I can think of would be to load the 2D document in the viewer and grab its properties. Otherwise you would need to download all viewables as exposed by the extract sample below, then reverse-engineer the sqlite db file that comes along to find those properties.
来源:https://stackoverflow.com/questions/42956703/how-do-i-get-metadata-from-a-2d-dwg-file-using-forge-autodesk-apis