以编程方式刷新层使用信息
在 AutoCAD 中,通过图层属性管理器 UI,用户可以刷新图形中图层的使用信息。当您拥有来自外部参照的图层时,信息有时会变得陈旧。在您的代码中,当您访问绘图的 LayerTable
时,其记录将不包括它认为未使用的那些图层(在图层属性管理器 UI 中,灰色状态 = 未使用,蓝色状态 = 使用)。为了让我到达这些层,我的程序首先需要刷新使用信息。有没有办法通过 .NET API、COM API 或命令行来执行此操作?
我也在 AutoCAD 论坛中同时寻求答案
http://forums.autodesk.com/t5/NET/Programmatically-refresh-layer-usage-information-NET/mp/2794756
In AutoCAD, through the Layer Properties Manager UI, a user can refresh the usage information for layers in a drawing. The information sometimes get stale when you have layers from xrefs. In your code, when you access the LayerTable
for a drawing, its records will not include those layers that it deems as unused (in the Layer Properties Manager UI grey status = unused, blue status = used). In order for me to get to those layers, my program first needs to refresh the usage information. Is there a way to do this through the .NET API, COM API, or the command line?
I'm also pursing an answer in parallel in the AutoCAD forums
http://forums.autodesk.com/t5/NET/Programmatically-refresh-layer-usage-information-NET/m-p/2794756
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题似乎在于特定绘图中的实体之一已损坏。当其中一位用户重新创建图形(包括重新添加一些外部参照)并运行该程序时,它工作得很好。我还仔细检查了代码,这次肯定击中了正确的层。不过,我愿意接受有关如何检测 AutoCAD 图形中的损坏问题的建议或解决方案。
It seems that the problem was that one of the entities in the particular drawing was corrupt. When one of the users recreated the drawing (including re-adding some xrefs) and ran the program it worked just fine. I also double checked the code and it was definitely hitting the correct layers this time. I am however open to suggestions or solutions on how to detect corruption problems in AutoCAD drawings.