木頭集 发表于 2014-4-23 22:06:59

用GetPoint获取点坐标.

怎么把这个坐标的X,Y值返给一个数组.

lixegn 发表于 2014-4-23 22:28:29

本身返回就是一个3个值的数组

木頭集 发表于 2014-4-23 22:43:15

lixegn 发表于 2014-4-23 22:28 static/image/common/back.gif
本身返回就是一个3个值的数组

你能不能写个代码,我写了一个,一直出错,显示主窗口不可见

lixegn 发表于 2014-4-24 22:07:46

木頭集 发表于 2014-4-23 22:43 static/image/common/back.gif
你能不能写个代码,我写了一个,一直出错,显示主窗口不可见

帮助的范例
Sub Example_GetPoint()
    ' This example returns a point entered by the user.
   
    Dim returnPnt As Variant
   
    ' Return a point using a prompt
    returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
    MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2) & vbCrLf & _
            "(Enter the next value without prompting.)", , "GetPoint 示例"
   
    ' Return a point, no prompt
    returnPnt = ThisDrawing.Utility.GetPoint
    MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetPoint 示例"
   
    ' Return a point using a base point and a prompt
    Dim basePnt(0 To 2) As Double
    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
    returnPnt = ThisDrawing.Utility.GetPoint(basePnt, "Enter a point: ")
    MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2)
   
    ' Create a line from the base point and the last point entered
    Dim lineObj As AcadLine
    Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, returnPnt)
    ZoomAll
   
End Sub

木頭集 发表于 2014-4-25 09:31:34

lixegn 发表于 2014-4-24 22:07 static/image/common/back.gif
帮助的范例
Sub Example_GetPoint()
    ' This example returns a point entered by the user.


非常感谢,问题已经解决、
页: [1]
查看完整版本: 用GetPoint获取点坐标.