C : VBA  July 05, 2005

●ユーザー入力

Utility」には
Getxxx なるメソッドが幾つかある。

「オブジェクト モデル 」から
Document-Utility(一番下)

メソッドの一覧からGetPoint メソッドをクリック
サンプル コードから
_____________________________________________________________
Dim returnPnt As Variant

' Return a point using a prompt
returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
_____________________________________________________________
の部分をコピーし貼付け

同様にGetCorner メソッドサンプル コードから下記をコピー
_____________________________________________________________
returnPnt = ThisDrawing.Utility.GetCorner(basePnt, "Enter Other corner: ")
_____________________________________________________________


エディタに貼付け
下記に変更し試してみる。
-----------------------------------------------------
Sub Example_AddLine2()
' This example adds a line in model space
Dim returnPnt1 As Variant
Dim returnPnt2 As Variant

' Return a point using a prompt
returnPnt1 = ThisDrawing.Utility.GetPoint(, " 1点目を指定 : ")

returnPnt2 = ThisDrawing.Utility.GetCorner(returnPnt1, " 2点目を指定 : ")

Dim lineObj As AcadLine

' Create the line in model space
Set lineObj = ThisDrawing.ModelSpace.AddLine(returnPnt1, returnPnt2)

End Sub

Posted by m_eguchi at July 5, 2005 01:12 PM
トラックバックURL

このエントリーのトラックバックURL:
http://www.kkkxcec.com/supportwlog/mt-tb.cgi/24