[求助]当文字是插入的块时,如何用VBA编程序得到其字符.-->mccad转移
有时文字是从别的图中复制-粘贴的,如果不打破的话,能否直接得到文字内容.记住,在VBA中,模型空间和图纸空间也是图块,所以操作方法可以一样,只是针对的对
记住,在VBA中,模型空间和图纸空间也是图块,所以操作方法可以一样,只是针对的对象不同我就是不知道该用什么对象的什么属性
这种方法简单...
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
页:
[1]