关于块的坐标的问题
<P>在一张图上,有若干块,如何获得这些块中心点所在的坐标?不能用鼠标选取的方式,只能直接用程序得到某个块的坐标??</P> 用鼠标只能获得块插入点,属性点的坐标,要获得中心点的坐标只能用程序处理了,除非把插入点定为中心点就不用了 GetBoundingBox <P>那如何获得块大致在什么地方呢?大致坐标就可以了</P> 我想能不能在块中设置一个点,然后在外面通过程序获得这个点的坐标,那大致也是这个块的坐标了,可我怎么搞坐标都是0,0,大家帮我想想怎么处理这个问题。有没有其他什么好办法。 <PRE class=Code>Sub Example_GetBoundingBox()' This example creates a line in model space. It then finds the
' bounding box for the line and displays the corners of the box.
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
Dim lineObj As AcadLine
' Create the Line object in model space
startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
ZoomAll
Dim minExt As Variant
Dim maxExt As Variant
' Return the bounding box for the line and return the minimum
' and maximum extents of the box in the minExt and maxExt variables.
lineObj.GetBoundingBox minExt, maxExt
' Print the min and max extents
MsgBox "The extents of the bounding box for the line are:" & vbCrLf _
& "Min Extent: " & minExt(0) & "," & minExt(1) & "," & minExt(2) _
& vbCrLf & "Max Extent: " & maxExt(0) & "," & maxExt(1) & "," & maxExt(2), vbInformation, "GetBoundingBox Example"
End Sub</PRE> <P>我用insertpoint方法搞定了,谢谢了</P>
页:
[1]