简体   繁体   中英

Is there any way to make SVGs editable after loading them back onto the viewer with MarkupsCore?

So, I am currently running into the problem that after a user makes a markup, and I store it to the database, when I reload it, it is no longer able to be edited. I realize that the api was designed this way, but I am wondering if there is a way to add the markups back and still be able to change the text, move them, etc.

I really have no ideas, so any help or direction would be much appreciated.

You can edit saved markups as follow. This feature has been added to the API in release 2.16 :

// string with markups data generated with markupsExt.generateData()
var modelMarkups = '...';

// Load the markups extension
viewer.loadExtension('Autodesk.Viewing.MarkupsCore').then(function(markupsExt){

    markupsExt.show();

    // Load markups onto "layerA"
    markupsExt.loadMarkups(modelMarkups, "layerA"); 

     // Allow editing of markups in "layerA"
    markupsExt.enterEditMode("layerA");            
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM