本文介绍了我如何找到“关闭"数量?在autodesk forge的模型衍生API中的autocad文件上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够计算给定autocad文件中封闭的行序列的数量.例如,下面的较大圆圈内有4个封闭的对象:

I want to be able to count the number of enclosed line sequences in a given autocad file. For example there are 4 enclosed objects inside the larger circle below:

当我上传.dxf格式的非常复杂的2d设计时,我可以成功检索所有数量的直线和圆弧,但是我看不到任何方法来检索封闭对象的数量.使用Model Derivative API或与此相关的任何Autodesk API都可以做到这一点吗?

When I upload a very intricate 2d design in .dxf format, I can successfully retrieve all the number of lines and arcs, but I don't see any way to retrieve the number of enclosed objects. Is this possible with the Model Derivative API, or any of autodesk's APIs for that matter?

推荐答案

不幸的是,模型导数(MD)API不提供有关闭合曲线的信息.如果您已将图形加载到Forge Viewer(在浏览器中),则可以获取所有几何数据: https://forge.autodesk.com/blog/dump-geometries-2d-曲线并检查它们是否被其他一些算法关闭:检查曲线是否闭合如果它是具有一些闭合曲线的块,则将它们整理出来可能是一个挑战,因为在MD平移之后,几何不再是DXF/DWG的一种实体.它们只是原始数据.

Unfortunately, Model Derivative (MD) API does not provide the information on which are closure curves. While if you have loaded the drawing in Forge Viewer (in the browser), you can get all geometries data:https://forge.autodesk.com/blog/dump-geometries-2d-curveAnd check if they are closure by some other algorithms:Check if a curve is closedIf it is a block with some closed curves, it may be challenge to sort them out because after MD translates, the geometries are not a kind of entities of DXF/DWG anymore. They are primitives only.

如果您熟悉AutoCAD插件开发,另一种方法是利用Forge的设计自动化.然后在云端上运行该插件,以检查折线是否已关闭(通过AutoCAD API),还是一个区域(默认情况下已关闭)或其他可能性(仅通过AutoCAD API).如果要在Forge Viewer中突出显示它们,请使用它们的实体句柄.我们没有确切的示例,但是要开始使用Forge的设计自动化,这些文档可能会有所帮助: https://forge.autodesk.com/en/docs/design-automation/v3/developers_guide/overview/ https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/autocad/

The other way would be take advantage of Design Automation of Forge if you are familiar with AutoCAD plugin development. Then on the cloud, run the plugin to check if a polyline is closed (by AutoCAD API), or it is a region (so it is closed by default) or other possibilities (just by AutoCAD API).Finally, map the entities by their entity handle, if you want to highlight them in Forge Viewer. We do not have an exact sample, but to get started with Design Automation of Forge, the documents may be of help:https://forge.autodesk.com/en/docs/design-automation/v3/developers_guide/overview/https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/autocad/

这篇关于我如何找到“关闭"数量?在autodesk forge的模型衍生API中的autocad文件上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 16:44