求助,关于AcadSelectionSet
求助:怎样复制AcadSelectionSet对象,比如 :
Dim ssetObj As AcadSelectionSet<BR> Dim ssetObj2 As AcadSelectionSet<BR> Set ssetObj = CreateSelectionSet("sk")
…………
: ssetObj2(I) = ssetObj(J)【这样赋值出错,应该怎么赋值呢?】
我要达到的效果是把ssetObj(J)的全部内容赋给ssetObj2(I)
谢谢了。 用AddItem方法 Dim tmpObj As AcadEntity, i As Integer, xObj() As AcadEntity '合并选择集中的对象<BR> If InOutSet Is Nothing Or InSetX Is Nothing Then Exit Function<BR> If InSetX.Count = 0 Then Exit Function 'Else MsgBox InOutSet.Count<BR> ReDim xObj(i)<BR> For Each tmpObj In InSetX<BR> ReDim Preserve xObj(i)<BR> Set xObj(i) = tmpObj: i = i + 1
Next<BR> InSetX.Delete<BR> If UBound(xObj) = 0 And xObj(0) Is Nothing Then Exit Function<BR> InOutSet.AddItems (xObj) 小美菜 发表于 2004-11-8 20:24
Dim tmpObj As AcadEntity, i As Integer, xObj() As AcadEntity '合并选择集中的对象 If InOutSet Is Not ...
没作用。For Each tmpObj In InSetX 报错“运行时错误'438',对象不支持该属性或方法 雪山飞狐_lzh 发表于 2004-11-8 19:46
用AddItem方法
能否给个例子?
Dim a As AcadSelectionSet '假设a已经存在内容
Dim b As AcadSelectionSet
通过循环的方法,使用b.AddItem(a.item(ii))
循环拷贝或者将对象加入对象数组,使用CopyObjects方法
页:
[1]