52okok 发表于 2006-6-24 04:51:00

[求助]想作一个子函数,用于取得屏幕上选取的文字的值和3D坐标

怎么老出现 Type mismatch 问题?本人VB较弱,是不是Vb函数只能返回单值呀?
Public Function Get_Elev_BasePnt(ByVal Obj As AcadText) As Double
         Get_Elev_BasePnt(0) = obj.TextString
            Get_Elev_BasePnt(1) = Obj.InsertionPoint(0)
            Get_Elev_BasePnt(2) = Obj.InsertionPoint(1)
            Get_Elev_BasePnt(3) = Obj.InsertionPoint(2)
end fuction

xinghesnak 发表于 2006-6-24 08:19:00

Function Get_Elev_BasePnt(ByVal Obj As AcadText) As Variant
Dim curValue(3) As Double
curValue(0) = Obj.TextString
curValue(1) = Obj.InsertionPoint(0)
curValue(2) = Obj.InsertionPoint(1)
curValue(3) = Obj.InsertionPoint(2)
Get_Elev_BasePnt = curValue
End Function

雪山飞狐_lzh 发表于 2006-6-24 19:04:00

Dim curValue(3)

xinghesnak 发表于 2006-6-26 08:05:00

顶顶,笔误。。。。^_^
页: [1]
查看完整版本: [求助]想作一个子函数,用于取得屏幕上选取的文字的值和3D坐标