wei209 发表于 2005-10-7 22:29:00

ELEVATION值加常数

<P>Dim acadDoc As AcadDocument<BR>Set acadDoc = acadApp.ActiveDocument<BR>&nbsp;On Error Resume Next</P>
<P>Dim entity As AcadObject<BR>Dim i As Integer<BR>Dim j As Integer<BR>Dim rr As Integer<BR>rr = Text1.Text<BR>If acadDoc.ModelSpace.Count &lt;&gt; 0 Then<BR>&nbsp; i = acadDoc.ModelSpace.Count<BR>&nbsp; For j = 0 To i - 1<BR>&nbsp;&nbsp;&nbsp; Set entity = acadDoc.ModelSpace.Item(j)<BR>&nbsp;&nbsp;&nbsp; If entity.Layer = "DGX" Or entity.Layer = "dgx" Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; entity.Elevation = entity.Elevation + rr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; entity.Update<BR>&nbsp;&nbsp;&nbsp; End If<BR>&nbsp; Next j<BR>Else<BR>&nbsp; MsgBox "在模型空间中没有对象存在。"<BR>End If<BR>MsgBox "完成"<BR>End Sub</P>
<P>问题:1.反映太慢没有LISP快</P>
<P>   2.不知道处理到第几根线了</P>
<P>想法:请高手加上点,让处理线时有个进度条显示!</P>

mccad 发表于 2005-10-9 06:41:00

使用选择集可以相对快点。<BR>进度条可以使用对话框的形式,选择集的数量为100%,循环过程中按数量计算到多少了。
页: [1]
查看完整版本: ELEVATION值加常数