- 积分
- 73549
- 明经币
- 个
- 注册时间
- 2001-6-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2002-5-5 21:14:00
|
显示全部楼层
这种方法简单...
GetSubEntity 方法
它可以直接取得图元或嵌套图元的信息,取得后你就可以随便对其进行读取或更改。
语法:
object.GetSubEntity Object, PickedPoint, TransMatrix, ContextData[, Prompt]
样例:
Sub Example_GetSubEntity()
' This example prompts the user to select on object on the screen with a mouse click,
' and returns some information about the selected object.
Dim Object As Object
Dim PickedPoint As Variant, TransMatrix As Variant, ContextData As Variant
Dim HasContextData As String
On Error GoTo NOT_ENTITY
TRYAGAIN:
MsgBox "Use the mouse to click on an entity in the current drawing after dismissing this dialog box."
' Get information about selected object
ThisDrawing.Utility.GetSubEntity Object, PickedPoint, TransMatrix, ContextData
' Process and display selected object properties
HasContextData = IIf(VarType(ContextData) = vbEmpty, " does not ", " does ")
MsgBox "The object you chose was an: " & TypeName(Object) & vbCrLf & _
"Your point of selection was: " & PickedPoint(0) & ", " & _
PickedPoint(1) & ", " & _
PickedPoint(2) & vbCrLf & _
"This object" & HasContextData & "have nested objects."
Exit Sub |
|