求助:改变偏移直线的特性
求助高手:我用vba的.offset命令偏移形成了一条直线,现在想把偏移后生成的直线改变土层,该怎么实现呢? 如Set offline = objsel.Offset(10),其后用offline.layer="0",为何没有实现土层改变呢? 发程序上来 <p> Dim SsetObj As AcadSelectionSet<br/> Dim SsetName As String<br/> Dim objsel As AcadEntity<br/> Dim y(1 To 3) As Double<br/> Dim y_st(1 To 3) As String<br/> Dim offline As AcadLine</p><p> <br/> SsetName = "au100"<br/> On Error Resume Next<br/> For i = 0 To ThisDrawing.SelectionSets.Count - 1<br/> Set SsetObj = ThisDrawing.SelectionSets.Item(i)<br/> If SsetObj.Name = "au100" Then SsetObj.Delete<br/> Next i<br/> Set SsetObj = ThisDrawing.SelectionSets.Add(SsetName)<br/> '让用户在屏幕上选择要加入选择集的图元<br/> SsetObj.SelectOnScreen<br/> '遍历选择集合<br/> <br/> i = 1<br/> For Each objsel In SsetObj<br/> Set offline = objsel.Offset(10)<br/> <br/> offline.Layer = "0"</p><p> next</p><p>end sub</p> <p>Dim Offline As Variant </p><p></p><p>For Each objsel In SsetObj<br/> offline = objsel.Offset(10)<br/> <br/> offline(0).Layer = "0"</p><p> next</p><p>offline 是一个数组。</p><p></p><p>可以看offset的帮助。</p> <p>多谢楼上的,我按照楼上的改了还是没有更改土层啊?</p> <p> On Error Resume Next<br/>先把这个去了。你肯定哪出错了。</p><p>我试了的。是可以的。</p> <p>Dim offline As AcadLine改成Dim offline As Variant</p><p>offline.Layer = "0"改成offline(0).Layer = "0"</p><p></p> <p>问题解决了,非常感谢楼上的!!!</p>
页:
[1]