lsp中子函数的调用
<P> 请问lsp中怎么调用自定义的子函数</P><P> 新学lsp,多多请教</P> <P>先定义主函数,然后调用子函数</P>
<P>(defun c:zhuahnshu()</P>
<P>(zihanshu))</P>
<P>(defun zihanshu()</P>
<P>(功能))</P> <P>加载后,在命令行也可以用括号加函数名来运行。</P>
<P> </P> 太简单了,谢谢 <P> 如果需要带参数的子函数怎么加载比如<BR>(defun c:leng(/ xp1 xp2)</P>
<P> (setq xp1 (getpoint "\n起点:"))<BR> (setq xp2 (getpoint "\n终点:"))</P>
<P>??这里怎么调用子函数<BR> )</P>
<P>(defun long(/ xp1 xp2 l)</P>
<P> (setq l (distance xp1 xp2))</P>
<P>)</P> (defun c:leng(/ xp1 xp2)
<P> (setq xp1 (getpoint "\n起点:"))<BR> (setq xp2 (getpoint "\n终点:"))</P>
<P>(long xp1 xp2)<BR> )</P>
<P>(defun long(xp1 xp2 / )</P>
<P> (setq l (distance xp1 xp2))</P>
<P>)</P> 非常不错的程序,谢谢楼主分享
页:
[1]