不是不算,你设置断点看一下,实际是调用了子程序,问题是计算完成后没有恢复对话框,是第一段的主程序有问题,按下列方式试一下: (defun c:pls( / Bflag) (vl-load-com) (dcl_LoadProject "plus" T) (setq Bflag T) (while (= Bflag T) (setq Bflag nil) (dcl_Form_Show plus_plus) ) ) (defun c:plus_plus_btnp_OnClicked () (setq Bflag T) (dcl_Form_close plus_plus) (setq pt1 (getpoint " insert point1")) (setq pt2 (getpoint " insert point2")) (setq x1 (car pt1)) (setq x2 (car pt2)) (setq y1 (cadr pt1)) (setq y2 (cadr pt2)) (dcl_Control_SetText plus_plus_text1 (itoa (fix (dist1 x1 y1 x2 y2)))) ) (defun dist1(x1 y1 x2 y2 / ) (setq tt (sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1))))) (eval 'tt) )
|