Forge Viewer-如何编辑旧标记?

时间:2019-07-05 10:03:22

标签: autodesk-forge autodesk-viewer

我们正在通过loadMarkups扩展名上的Autodesk.Viewing.MarkupsCore方法将旧标记加载到视图中,但是我们正在努力寻找一种方法来启用对这些标记的编辑。当它们加载时,它们只是静态的,用户无法选择它们来移动或删除它们。

任何有关如何做到这一点的指针都将受到赞赏

谢谢!

2 个答案:

答案 0 :(得分:0)

您可以通过编程方式重新创建标记,以使它们可编辑:

var arrow = new Autodesk.Extensions.Markup.Core.CreateArrow(markupExt, id, head, , style);
arrow.execute()

并通过markupExt.markups访问标记对象以获取其详细信息以进行重建:

markupExt.markups[0]
/*
head: LMV../thirdparty/three.js/three.js.THREE.Vector3 {x: 284.1781874039939, y: -321.0445468509985, z: 0}
highlightColor: "#0696D7"
highlighted: false
id: 1
minHeight: -10000
minWidth: -10000
position: {x: 55.29953917050693, y: -313.36405529953913}
rotation: 0.03354445956167922
selected: false
shape: g
size: {x: 458.0149585664656, y: 9.216589861751004}
style: {stroke-width: 3.072196620583668, stroke-color: "#ff0000", stroke-opacity: 1, fill-color: "#ff0000", fill-opacity: 1}
tail: LMV../thirdparty/three.js/three.js.THREE.Vector3 {x: -173.57910906298002, y: -305.68356374807985, z: 0}
*/

答案 1 :(得分:0)

我通过简单地调用 enterEditMode() 解决了这个问题,并使用我保存的 LayerId 以及在我的数据库中生成的 SVG 数据,如下所示:

data() {
  return{
   wd: '', 
   arr: [], 
   listIndex: -1, 
   title:['name','sort','company'],
 }
}

这可以为我编辑保存的标记。但是,如果您实现了自己的自定义工具(类型),则它不起作用。

相关问题