1

Revitファイルをアップロードし、ビューアに読み込んで読み込むすべての手順を実行できます。私は現在、翻訳されたSVG/SVFをオフラインで見るためにダウンロードしようとしています。私は、次のエンドポイントへの参照を発見し、これでそれをテストした:Autodesk Model Forge APIを使用してオフラインで表示するためのSVG/SVFをダウンロードするには

function download(){ 
var uri = 'https://developer.api.autodesk.com/derivativeservice/v2/derivatives/<<urn>>' ; 
var authorizationHeader = 'Bearer <<token>>' 

request.get(
    { 
     url: uri,  
     headers: 
     { 
      'Authorization': authorizationHeader, 
      'Accept-Encoding': 'gzip, deflate' 
     }, 
    }, 

    function(error, response, body){ 
     if(!error){ 
      console.log(body); 
     }else{ 
      console.log(error); 
     } 
    }); 
} 

APIリターン:
{ "診断": "誘導体APIのみ& adsk.objects骨壷をadsk.viewingサポート"}

答えて

2

オフラインで表示するために必要なファイルをすべて取得する場合は、いくつかの手順があります。抽出projectdownloadBubble方法(Node.jsの)をチェックすることで起動します。

this.downloadBubble =function (urn, outPath) { 
    var self =this ; 
    self._outPath =outPath ; 
    return (new Promise (function (fulfill, reject) { 
     self._progress.msg ='Downloading manifest' ; 
     self.getManifest (urn) 
      .then (function (bubble) { 
       //utils.writeFile (outPath + 'bubble.json', bubble) ; 
       self._progress.msg ='Listing all derivative files' ; 
       self.listAllDerivativeFiles (bubble.body, function (error, result) { 
        self._progress._filesToFetch =result.list.length ; 
        console.log ('Number of files to fetch:', self._progress._filesToFetch) ; 
        self._progress._estimatedSize =0 | (result.totalSize/(1024 * 1024)) ; 
        console.log ('Estimated download size:', self._progress._estimatedSize, 'MB') ; 

        //self.fixFlatBubbles (result) ; 
        //self.fixFusionBubbles (result) ; 

        self._progress.msg ='Downloading derivative files' ; 
        self.downloadAllDerivativeFiles (result.list, self._outPath, function (failed, succeeded) { 
         //if (++self._done == 1 /*2*/) 
         // return ; 
         self.failed =failed ; 
         self.succeeded =succeeded ; 
         fulfill (self) ; 
        }) ; 
       }) ; 
      }) 
      .catch (function (err) { 
       console.error ('Error:', err.message) ; 
       self._errors.push (err.message) ; 
       reject (self) ; 
      }) 
     ; 
    })) ; 
} ; 

それは私があなたのバブルオブジェクトを使用していますhttps://extract.autodesk.io

+0

に住んでテスト。よく働く。ありがとう。 –

3

urnは、base64でエンコードされているのではなく、URLでエンコードされている必要があります。

関連する問題