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

获取面域属性信息问题

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

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

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

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

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