翔羽 发表于 2007-10-11 22:40:00

获取面域属性信息问题

<p>是这样的:在cad中,可以用massprop命令查询选定面域或实体的特性属性,比如面积,惯性矩等等,现在情况是:我在vba中选定了一个面域,并用sendcommand方法调用massprop命令查询该面域的属性,请问怎么样获取这些属性信息?这些信息在后续的编程中还需要用到,请高手多多指教!!!</p>

alin 发表于 2007-10-12 07:28:00

<p>用sendcommand方法调用massprop命令查询该面域的属性? 为什么要那样做?</p><p>Sub Ch4_CreateRegion()<br/>&nbsp;&nbsp;&nbsp; ' Define an array to hold the<br/>&nbsp;&nbsp;&nbsp; ' boundaries of the region.<br/>&nbsp;&nbsp;&nbsp; Dim curves(0 To 0) As AcadCircle</p><p>&nbsp;&nbsp;&nbsp; ' Create a circle to become a<br/>&nbsp;&nbsp;&nbsp; ' boundary for the region.<br/>&nbsp;&nbsp;&nbsp; Dim center(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp; Dim radius As Double<br/>&nbsp;&nbsp;&nbsp; center(0) = 2<br/>&nbsp;&nbsp;&nbsp; center(1) = 2<br/>&nbsp;&nbsp;&nbsp; center(2) = 0<br/>&nbsp;&nbsp;&nbsp; radius = 5#<br/>&nbsp;&nbsp;&nbsp; Set curves(0) = ThisDrawing.ModelSpace.AddCircle _<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (center, radius)</p><p>&nbsp;&nbsp;&nbsp; ' Create the region<br/>&nbsp;&nbsp;&nbsp; Dim regionObj As Variant<br/>&nbsp;&nbsp;&nbsp; regionObj = ThisDrawing.ModelSpace.AddRegion(curves)<br/>&nbsp;&nbsp;&nbsp; MsgBox regionObj(0).ProductOfInertia</p><p>&nbsp;&nbsp;&nbsp; ZoomAll<br/>End Sub</p>

xianglongg 发表于 2011-11-21 16:48:47

这个是圆周率呀
页: [1]
查看完整版本: 获取面域属性信息问题