zxwknight822 发表于 2007-6-28 13:09:00

求图层变换程序

<p>请问高手。</p><p>图层建好后 有 1 2 3 4 5 6.....</p><p>在选择对象后通过键盘输入1 2 3 4 6 ....中任意一个数字被选对象就变到数字相对应的图层中去了。</p>

鬼魔 发表于 2007-6-28 15:22:00

<a href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=60228">http://bbs.mjtd.com/forum.php?mod=viewthread&tid=60228</a>

mingvictor 发表于 2007-10-7 20:34:00

<p>我这里有一些你看看!</p><p>(defun c:00 () (command "LAYER""S""00""")) </p><p>(defun c:01 () (command "LAYER""S""01"""))<br/>(defun c:02() (command "LAYER""S""02"""))<br/>(defun c:03 () (command "LAYER""S""03"""))<br/>(defun c:04 () (command "LAYER""S""04"""))<br/>(defun c:05 () (command "LAYER""S""05"""))<br/>(defun c:1 () (command "LAYER""S""1"""))<br/>(defun c:11 () (command "LAYER""T""11""S""11"""))<br/>(defun c:12 () (command "LAYER""S""12"""))<br/>(defun c:13 () (command "LAYER""S""13"""))<br/>(defun c:14 () (command "LAYER""S""14"""))<br/>(defun c:15() (command "LAYER""S""15"""))<br/>(defun c:16 () (command "LAYER""S""16"""))<br/>(defun c:17 () (command "LAYER""S""17"""))<br/>(defun c:18 () (command "LAYER""S""18"""))<br/>(defun c:2 () (command "LAYER""S""2"""))<br/>(defun c:3 () (command "LAYER""S""3"""))<br/>(defun c:5 () (command "LAYER""S""5"""))<br/>(defun c:51 () (command "LAYER""S""51"""))<br/>(defun c:52 () (command "LAYER""S""52"""))<br/>(defun c:53 () (command "LAYER""S""53"""))<br/>(defun c:54 () (command "LAYER""S""54"""))<br/>(defun c:55 () (command "LAYER""S""55"""))<br/>(defun c:56 () (command "LAYER""S""56"""))<br/>(defun c:57 () (command "LAYER""S""57"""))<br/>(defun c:58 () (command "LAYER""S""58"""))<br/>(defun c:6 () (command "LAYER""S""6"""))<br/>(defun c:7 () (command "LAYER""S""7"""))<br/>(defun c:71 () (command "LAYER""S""71"""))<br/>(defun c:72 () (command "LAYER""S""72"""))<br/>(defun c:73 () (command "LAYER""S""73"""))<br/>(defun c:75 () (command "LAYER""S""75"""))<br/>(defun c:76 () (command "LAYER""S""76"""))<br/>(defun c:77 () (command "LAYER""S""77"""))<br/>(defun c:78 () (command "LAYER""S""78"""))<br/>(defun c:8 () (command "LAYER""S""8"""))</p>

phonexi 发表于 2007-10-8 11:33:00

<p>都是lsp</p><p>来个vba的</p><p>Sub Example_layer()</p><p>&nbsp;&nbsp;&nbsp; Dim layerobj As AcadLayer<br/>&nbsp;&nbsp;&nbsp; Dim obj As AcadEntity<br/>&nbsp;&nbsp;&nbsp; Dim pt As Variant<br/>&nbsp;&nbsp;</p><p>&nbsp;&nbsp; '创建图层<br/>&nbsp;&nbsp;&nbsp; For i = 1 To 10<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set layerobj = ThisDrawing.Layers.Add(CStr(i))<br/>&nbsp;&nbsp;&nbsp; Next i<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; On Error Resume Next<br/>&nbsp;&nbsp;&nbsp; ThisDrawing.Utility.GetEntity obj, pt, "选择对象:"<br/>&nbsp;&nbsp;&nbsp; If Err &lt;&gt; 0 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim LayerName As String<br/>&nbsp;&nbsp;&nbsp; Do<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LayerName = ThisDrawing.Utility.GetString(5, "输入图层名:")<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i = 0 To Layers.Count - 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If UCase(Layers.Item(i).Name) = UCase(LayerName) Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obj.Layer = LayerName<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Do<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next i<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.Utility.Prompt "输入的图层不存在,重新输入!" &amp; vbCr<br/>&nbsp;&nbsp;&nbsp; Loop</p><p>End Sub<br/></p>
页: [1]
查看完整版本: 求图层变换程序