Autodesk forge 标记核心

Autodesk forge Markups Core

我在 Autodesk Forge Viewer 中有一个用于 3D 模型的标记扩展。我只删除一个标记时遇到问题。我想知道是否可以在编辑模式下显示注释或在显示模式下删除标记。当我尝试在编辑模式下显示标记时,我看到一条警告 "markups cant be showed in editing mode." 有谁知道如何解决这个问题?

编辑

并在图层加载后删除特定标记尝试:

markExt.svgLayersMap['layerId'].markups[index].destroy()

在显示标记之前离开编辑模式 -(响应用户输入)您可以在显示标记后以编程方式重新进入编辑模式:

ext.leaveEditMode()
ext.loadMarkups(asb,'233') //or ext.showMarkups(layerID)
ext.enterEditMode()

要删除标记,请尝试:

ext.markups[0].destroy()

show annotations in edit mode

不确定您要在这里实现什么目标?但是您可以通过编程方式创建文本标记 - 例如 exp:

const styleObject = Autodesk.Viewing.Extensions.Markups.Core.Utils.createStyle(['font-size'], window.ext);
 styleObject['font-size'] = 100;
 (new Autodesk.Viewing.Extensions.Markups.Core.CreateText(window.ext, 2333, {x:20,y:20}, {x:100,y:100},'233', styleObject)).execute()

or delete markups in show mode. And in show mode if the markups are loaded you will need to hide on their layer level and wouldn't be able to hide a specific markup - you may fine tune this by separating them to different layers