如题,我使用下面代码取到了参考中的元素,但是SelectionSetManager.AddElement 添加元素之后在模型中没有高亮显示,显示集设置也无用。
DgnFile dgnfile = Session.Instance.GetActiveDgnFile(); DgnModel dgnmodel = Session.Instance.GetActiveDgnModel(); DgnAttachmentCollection attachcol = dgnmodel.GetDgnAttachments(); foreach (DgnAttachment myattach in attachcol) { DgnModel newmodel = myattach.GetDgnModel(); ModelElementsCollection collection = newmodel.GetGraphicElements(); IEnumerator<Element> iter = collection.GetEnumerator(); while (iter.MoveNext()) { Element ele1 = iter.Current; SelectionSetManager.AddElement(ele1, ele1.DgnModelRef); } }
SelectionSetManager.AddElement第二个参数换一下:SelectionSetManager.AddElement(ele1, myattach);
Answer Verified By: 润风 马
成了,我试了填dgnmodel、newmodel和ele1.DgnModelRef,唯独没试myattach,SDK里也没写明这个参数啥意思,请问有二开相关的学习资源吗,视频或文本形式都行哈
可以看一下这个网站:https://bentley-learn.com/
好的,谢谢郭老师