70001408 How i can get the entities of an external reference document

Article 70001408
Type HowTo
Product WebJS
Version 8
Date Added 10/2/2018
Fixed 8.8001.0.1 (10/2/2018)
Submitted by Brendan Fry

Summary

How i can get the entities of an external reference document.

Solution

Here is an example for you to get the entities of an external reference document.


   var blk = vdcanvas.AddBlockFromFile("test.vds", "myblock", false, _loadedDelegate);
 
   function _loadedDelegate(xrefargs) {
       var xrefdoc = xrefargs.documentdata.vdDocument; 
       var block = xrefargs.Block; 
       var entities = xrefdoc.Model.Entities.Items;
       var fig; 
       for (var i = 0; i < entities.length; i++) { 
             fig = xrefdoc[entities[i]]; 
       } 
      vdcanvas.scriptCommand.blockref("myblock", null);
   } 
 


Send comments on this topic.