先定义了一个acadpolyline变量,用pline命令画了一条多义线,然后在vba程序里用选择集的SelectOnScreen选择这条多义线,然后用选择集的item方法把选择结果赋给这个acadpolyline变量,结果不成功,错误提示为type mismatch。
代码如下:
Sub DrawConcreteBrace()
Dim line As AcadPolyline
Dim sset As AcadSelectionSet
Set sset = ThisDrawing.SelectionSets.Add("test")
ThisDrawing.Utility.Prompt vbLf & "请选择多义线:"
sset.SelectOnScreen
Set line = sset.Item(0)
sset.Delete
End Sub