【求助】代码出现错误438,求解!
写了一段代码:Dim sset2 As AcadSelectionSet
Set sset2 = sset.GetAcadSelectionSet
其中
Private m_sset As AcadSelectionSet '选择集对象
Public Function GetAcadSelectionSet() As AcadSelectionSet '用于返回选择集对象,允许用户直接操作选择集对象
Debug.Assert (Not m_sset Is Nothing)
Set GetAcadSelectionSet = m_sset
End Function
为何总是提示对象不支持这个属性或方法(错误 438)
请高人指教 --------------------编程问答-------------------- AUTOCAD的VBA代码?
没在那个环境下用过VBA,不过看你的代码也没贴全:)不知
Set sset2 = sset.GetAcadSelectionSet
中的sset是啥类型啊,可能是它没GetAcadSelectionSet成员吧 --------------------编程问答-------------------- 抱歉
其中sset是类模块clsSelectionSet的一个实例
Dim sset As New clsSelectionSet '建立选择集sset
sset.Create "sset"
--------------------编程问答-------------------- 是在cad下的vba,完整代码如下:
Public Sub test_Add3dface() '建立3dface
Dim sset As New clsSelectionSet '建立选择集sset
sset.Create "sset"
Dim pt1 As Variant
Dim pt2 As Variant
pt1 = ThisDrawing.Utility.GetPoint(, vbNewLine & "拾取点:")
pt2 = ThisDrawing.Utility.GetPoint(, vbNewLine & "拾取另一点:")
sset.SelectEntity acSelectionSetCrossing, pt1, pt2
Dim sset2 As AcadSelectionSet
Set sset2 = sset.GetAcadSelectionSet
Dim face3D As New cls3dEntitySet
Dim face As Acad3DFace
Set face = face3D.Add3dFace(sset2.Item(0).Coordinate, sset2.Item(1).Coordinate, sset2.Item(2).Coordinate)
MsgBox "对象个数为:" & sset.Count
End Sub
其中GetAcadSelectionSet是clsSelectionSet类模块下的过程
Private m_sset As AcadSelectionSet '选择集对象
Public Function GetAcadSelectionSet() As AcadSelectionSet '用于返回选择集对象,允许用户直接操作选择集对象
Debug.Assert (Not m_sset Is Nothing)
Set GetAcadSelectionSet = m_sset
End Function
总是提示对象不支持这个属性或方法(错误 438),求教原因。
补充:VB , VBA