找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2733|回复: 4

[求助] 怎样求封闭图形的面积

[复制链接]
发表于 2014-8-1 14:57:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
怎样求图形中封闭区域的面积 以及自动绘制封闭区域
CAD本身提供了boundary 怎样编程实现
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 145个

财富等级: 日进斗金

发表于 2014-8-1 21:11:23 | 显示全部楼层
You can use the command line version of the "BOUNDARY" AutoCAD command. For
example, you can use the following function call:


ads_command(RTSTR,"_.-boundary", 0 );
Using the _. prefix on the command ensures that the original boundary command
is invoked, even if the command has been redefined. If you want to allow just
one point selection, you can use the following:


ads_command(RTSTR,"_.-boundary",RTSTR, "\\", RTSTR, "", 0);
When you know the internal point, you can use the following code:


struct resbuf *arglist;
ads_point pt1;      //pt1 is an internal area point

pt1[X] = 7.0;
pt1[Y] =5.0;
pt1[Z]=0.0;

arglist = ads_buildlist(RTSTR, "_.-boundary", RTPOINT, pt1, RTSTR, "", 0);

ads_cmd(arglist);
ads_relrb(arglist);
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

发表于 2014-8-1 21:12:19 | 显示全部楼层
There is not an ARX function that will find the boundary of a point by selecting the point inside an area enclosed by entities. A quick workaround to consider would be to find the boundary of a point by using the command line version of the boundary command.  "-Boundary"

This example creates a boundary for the selected point.



void asdkpboundary()
{
  ads_point pt;
  ads_name pent;
  acedGetPoint(NULL, L"Pick a point: ", pt);  
  acedCommand(RTSTR, L"-boundary", RTPOINT, pt, RTSTR, L"", RTNONE);
  acdbEntLast(pent);
  acedRedraw(pent, 3);
}
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 859个

财富等级: 财运亨通

发表于 2014-8-2 00:00:01 | 显示全部楼层
ARX  2015

Acad::ErrorStatus acedTraceBoundary(
    const AcGePoint3d& seedPoint,
    bool detectIslands,
    AcDbVoidPtrArray& resultingBoundarySet
);

Point3d seedPoint
The seed point, in UCS, for the boundary trace.
[MarshalAs(UnmanagedType.U1)] bool detectIslands
A boolean indicating whether or not to detect islands.

Returns

The resulting boundary set in a DBObjectCollection if the operation completed sucessfully. When called with detectIslands set to false, the result contains only one entry, representing the outer boundary. When called with detectIslands set to true, the result contain multiple entries. In this case, the last entry is the outermost boundary, and the succeeding entries represent the islands found.



[url=]

                               
登录/注册后可看大图
Description[/url]

Returns the resulting boundary set in a DBObjectCollection



论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 859个

财富等级: 财运亨通

发表于 2014-8-2 00:05:13 | 显示全部楼层
ARX 2015

Acad::ErrorStatus acedTraceBoundary(
    const AcGePoint3d& seedPoint,
    bool detectIslands,
    AcDbVoidPtrArray& resultingBoundarySet
);

Point3d seedPoint
The seed point, in UCS, for the boundary trace.
[MarshalAs(UnmanagedType.U1)] bool detectIslands
A boolean indicating whether or not to detect islands.
Returns
The resulting boundary set in a DBObjectCollection if the operation completed sucessfully. When called with detectIslands set to false, the result contains only one entry, representing the outer boundary. When called with detectIslands set to true, the result contain multiple entries. In this case, the last entry is the outermost boundary, and the succeeding entries represent the islands found.

Returns the resulting boundary set in a DBObjectCollection



论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-10 05:38 , Processed in 0.278027 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表