明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1879|回复: 5

为什么我不能读取选择集的参数

[复制链接]
发表于 2005-6-24 09:56:00 | 显示全部楼层 |阅读模式
Dim ssetObj As AcadSelectionSet
Dim FilterType(5) As Integer
Dim FilterData(5) As Variant
Dim element As AcadEntity
Dim qidian(2) As Double
Dim zhongdian(2) As Double Set ssetObj = ThisDrawing.SelectionSets.Add("ssetObj")

FilterType(0) = -4
FilterData(0) = "<or"
FilterType(2) = 8
FilterData(2) = "0"
FilterType(3) = 0
FilterData(3) = "Line"
FilterType(4) = 0
FilterData(4) = "Polyline"
FilterType(5) = -4
FilterData(5) = "or>" ssetObj.SelectOnScreen FilterType, FilterData

For Each element In ssetObj
If element.ObjectName = "AcDbLine" Or element.ObjectName = "AcDbPolyline" Then
element.color = acBlue
element.Update
qidian(0) = element.startPoint(0)
End If
Next 以上程序为了得到选择集直线的起点终点坐标 ,但是 qidian(0) = element.startPoint(0)我却得到报错的信息,用监视器监视element.startPoint是有参数的,我测试画的都是直线
发表于 2005-6-24 11:06:00 | 显示全部楼层
If element.ObjectName = "AcDbLine" Or element.ObjectName = "AcDbPolyline" Then
element.Color = acBlue
element.Update
temp = element.StartPoint
qidian(0) = temp(0)
End If
 楼主| 发表于 2005-6-24 11:35:00 | 显示全部楼层
temp改设为数组么,还是什么变量呢?
 楼主| 发表于 2005-6-24 11:41:00 | 显示全部楼层
我把temp设置为acadpoint


然后按你说的写,可是出的错误是


错误“91”,对变量或with块变量未设置
发表于 2005-6-24 12:04:00 | 显示全部楼层
dim temp


设置为变体
 楼主| 发表于 2005-6-24 14:58:00 | 显示全部楼层
谢谢!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 15:50 , Processed in 0.175328 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表