关于2002和2005??
我不太清楚在2002和2005以及2004中使用LISP程序,存在哪些不兼容的成分!如以下的程序我在2005中能运行,可到了2002中就不可以,找不到<FONT color=#f73809>vlax-ename->vla-object </FONT><FONT color=#000000> 这个程序命令</FONT>
(defun C:PRINT()<BR> (defun GetBox(ent / pt1 pt2)<BR> (vla-getboundingbox (<FONT color=#f73809>vlax-ename->vla-object <FONT color=#000000>e</FONT></FONT><FONT color=#000000>nt</FONT>) 'pt1 'pt2)<BR> (mapcar 'vlax-safearray->list (list pt1 pt2))<BR> )<BR> (setq point1 (getpoint "\n请确定要打印的区域: "))<BR> (setq point2 (getcorner point1 "\n请确定区域的对角点 : "))<BR> (setq name (getstring"\n请输入要打印图框的图块名:"))<BR> (setq ss (ssget "w" point1 point2(list '(0 . "INSERT") (cons 2 name))))<BR> (setq i 0)<BR> (repeat (sslength ss)<BR> (setq ent (ssname ss i))<BR> (setq pts (list (GetBox ent)))<BR> (setq pt(car pts))<BR> (setq point(car pt))<BR> (setq zuob (append zuob (list point)))<BR> (setq i (1+ i))<BR> )<BR> (setq zuob (vl-sort zuob '(lambda(e1 e2) (<(fix(car e1)) (fix(car e2))) )))<BR> (setq zuob (vl-sort zuob '(lambda(e1 e2) (>(fix(cadr e1)) (fix(cadr e2))))))<BR> (mapcar '(lambda(e) (command "-plot" "y" "" "" "" "M" "L" "N"<BR> "W" e (list (+ (car e) 420) (+ (cadr e)297))<BR> "" "C" "Y" "" "Y" "N" "N" "N" "Y"))zuob)<BR> (print zuob)(setq zuob nil)<BR> ) 在lisp 使用到vl的功能要先运行 (vl-load-com) 这句行可以用 请详细点,你知道我是很菜的! 把(vl-load-com)这句加到(defun GetBox(ent / pt1 pt2)<BR>后面就可以了 谢谢各位高人!不过,这些到底是怎么回事,但是在2005里为什么就可以不通过(VL-LOAD-COM)就可以运行呢? 应该学会查看帮助文件。。。VL-LOAD-COM是做什么的帮助文件中就有。。。至于为什么2005不用加载,想想就明白了,都用到2005了,开发肯定要用VLISP了,所以就默认自动加载了VLISP扩展功能(我是这么想的)
页:
[1]