如何使用Forge AutoDesk API从2d .dwg文件中获取元数据? [英] How do I get metadata from a 2d .dwg file using Forge AutoDesk APIs?

查看:164
本文介绍了如何使用Forge AutoDesk API从2d .dwg文件中获取元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Forge AutoDesk数据管理,设计管理和模型查看器API上传我的.dmg,将其转换为svf,然后使用元数据.它适用于3D设计,但是当我使用2D设计时,元数据内部似乎没有任何向导.我在做错什么吗?

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?

我可以找到清单,但是当我获取相同的元数据时,它会提供一个空数组.

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"
        }
       ]
      }
     ]
    }
   ]
  }

编辑 2 在转换其他dwg文件时,我在响应正文中收到此消息作为警告,这也可能是我无法获得该消息的原因吗?元数据?

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"
           }
          ]
         }
       ]
     }
   ]
 }

推荐答案

不幸的是,获取元数据尚不适用于2D文档.这已被记录下来,将由开发团队实施.

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.

我可以想到的解决方法是将2D文档加载到查看器中并获取其属性.否则,您将需要下载下面的提取示例所公开的所有可见内容,然后对随附的sqlite db文件进行反向工程以找到这些属性.

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://extract.autodesk.io

这篇关于如何使用Forge AutoDesk API从2d .dwg文件中获取元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆