getpoint 变量未设置
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_shrink.gifSub data_x()
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim linex As AcadLine
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim pt(1) As AcadPoint
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim part As AcadPoint
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim doubl As Double
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifpt(0) = ThisDrawing.Utility.GetPoint
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifpt(1) = ThisDrawing.Utility.GetPoint()
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifSet linex = ThisDrawing.ModelSpace.AddLine(pt(0), pt(1))
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifEnd Sub
还有:
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_shrink.gifSub data_x()
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim linex As AcadLine
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim pt1, pt2 As AcadPoint
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim part As AcadPoint
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifDim doubl As Double
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifpt1 = ThisDrawing.Utility.GetPoint(, "a")
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifpt2 = ThisDrawing.Utility.GetPoint(, "d")
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifSet linex = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
[*]http://club.excelhome.net/source/plugin/mc_colorcode/images/jssc_none.gifEnd Sub
这样的时候就是pt2时报错……
我知道用variant的
只是,这两者之间的差别让我费解。有人能解释下么?
本帖最后由 雪山飞狐_lzh 于 2012-7-14 22:50 编辑
Dim pt1, pt2 As AcadPoint
VB里这样声明是错误的
等同于
Dim pt1 as variant, pt2 As AcadPoint
不过VB.Net可以。。。 getpoint方法得到的是三维点坐标,是一个三元素双精度数组.声明变量时应该声明为变体变量(双精度动态数组也可以)
而楼主声明为acadpoint是不对的,这是一个单点对象,是一个图元,要用addpoint方法画出来的.
二者风马牛不相及. 雪山飞狐_lzh 发表于 2012-7-14 22:48 static/image/common/back.gif
Dim pt1, pt2 As AcadPoint
VB里这样声明是错误的
等同于
……这样啊
我是看例子里面都是这样定义的……
怪不得 Dim pt1, pt2 As AcadPoint
改为:dim pt1,pt2
页:
[1]