[求助]如何让建构线,画出来就变色
<p align="left">大家好 </p><p align="left">我想要写一个建构线的快捷键,但是画出来的建构线都是白色的,容易影响视图</p>
<p align="left">请问我该如何写,才能让画出来的建构线变成红色的呢</p>
<p align="left">我最近刚接触LISP,自己有尝试写写看,但是都弄不出来,还请各位大德帮小弟个忙</p>
<p align="left"> </p>
<p align="left"><font face="Verdana">(defun C:XV()<br/> (SETVAR "CMDECHO" 0)<br/> (command "XLINE" "V")<br/> (command "chprop"(entlast) "C" "T" "255,0,0")<br/> (prin1)<br/>)</font></p>
<p align="left"> </p>
<p align="left"> </p> <div><div>(defun C:XV()</div><div> (SETVAR "CMDECHO" 0)</div><div> (command "XLINE" "V" pause )</div><div> (while (= (logand (getvar "CmdActive") 1) 1) (command))</div><div> (command "_.chprop" (entlast) "" "C" "1" "")</div><div> (prin1)</div><div>)</div></div> <p>謝謝你的幫助,可以正常使用</p>
<p>我最近刚接触这程式,很多地方不懂,还请你指点一下</p>
<p> </p>
<p> (command "XLINE" "V" pause ) 此处的"pause"的作用是什么,有加跟没有加的差异在哪里</p>
<p> </p>
<p> (command "_.chprop" (entlast) "" "C" "1" "") </p>
<p>为什么呼叫chprop指令时要打成"_.chprop"而后在呼叫"line"的时候可以不用?</p>
<p>在刚呼叫chprop出来之后,不是紧接着就选颜色(c),为什么 还多了 "" ,而不是直接 "c"??</p>
<p> </p>
<p> </p>
<p>我适才想要依照你的模组弄 XLINE/O(偏移复制),却发现无法成功。</p>
<p>另外,有在公司用的CAD是2010的,里头有很多积类的建构线。例如,选取两条平行线,就会自动产生两线中间的建构线,或是点选两个建立一条建构线。可是在旧一点的CAD中,就没有那么多选项。</p>
<p>这样的情况下,能用LISP来突破吗?</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p> 看看帮助pause表示暂停等待你的输入.<div>""等价于你的回车</div><div>加"_."不同语言版本的cad的统一命令.</div> <p>謝謝你的回答^^</p>
<p>幫助我很多</p> <p>你好,我如何在cad中输入了一次指令后,然后,一直点右键就有一直出现建构线??</p>
<p>原本的是要输入一次指令,点一个建构线</p>
<p>之后,你若还想要再使用,就还得再点一次。</p>
<p> </p>
<p>不知道这样的话,程式该如何更改???</p> <div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; ">(defun C:XV()</div><div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; "> (SETVAR "CMDECHO" 0)</div><div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; "> (command "XLINE" "V" )</div><div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; "> (while (= (logand (getvar "CmdActive") 1) 1) (command <span class="Apple-style-span" style="font-size: 15.6px; ">pause))</div><div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; "> (command "_.chprop" (entlast) "" "C" "1" "")</div><div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; "> (prin1)</div><div style="font-family: Arial, Helvetica, sans-serif; list-style-type: none; list-style-position: initial; list-style-image: initial; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 19px; ">)</div></span> <font face="Verdana">(defun c:tt ()<br/> (command "color" 1)<br/> (command "XLINE" "V")<br/> (while (setq p1 (getpoint "\n基点<退出>: "))<br/> (command p1)<br/> )<br/> (command "")<br/> (princ)<br/>)</font> <p>謝謝二位寫了程式給我</p>
<p>兩段程式都可以使用</p>
<p> </p>
<p>但是xshrimp, 你後來再寫的這段,顏色無法改變。可以連續建立建構線</p>
<p>xyp1964,你的程式碼,是會變成紅色,但是之後我再畫圓或是直線,出來的也都變成紅色了</p>
<p> </p>
<p> </p>
<p> </p>
<div> </div>
<p> </p>
<p> </p>
<p> </p>
<p> </p> 本帖最后由 作者 于 2010-8-26 23:23:48 编辑 <br /><br /> <p><font face="Verdana">(defun c:tt ()<br/> (setq co (getvar "cecolor"))<br/> (command "color" 1)<br/> (command "XLINE" "V")<br/> (while (setq p1 (getpoint "\n基点<退出>: "))<br/> (command p1)<br/> )<br/> (command "")<br/> (setvar "cecolor" co)</font></p>
<p><font face="Verdana"> (princ)<br/>)</font></p>
页:
[1]
2