你好,我的朋友,我需要一点帮助。
我有下面的lisp,可以进行相同的计算
- (vl-load-com)
- (defun c:cal(/ A E I L S K)
- (if
- (and (setq
- s (ssget '((0 . "ARC,CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE")
- (-4 . "<AND")
- (0 . "LWPOLYLINE")
- (70 . 1)
- (-4 . "AND>")
- )
- )
- )
- (progn
- (initget "A B")
- (setq
- k (cond
- ((getkword "\n For calculation select [Type 1 (Α) / Type 2 (Β)] < A > :"))
- ("A")
- )
- )
- )
- )
- (progn
- (setq l 0.0
- a 0.0
- i 0
- )
- (while (< i (sslength s))
- (progn
- (setq e (ssname s i)
- l (+ l
- (vlax-curve-getdistatparam e (vlax-curve-getendparam e))
- )
- a (+ a (vlax-curve-getarea e))
- )
- )
- (setq i (1+ i))
- )
- (textscr)
- (princ "\n")
- (princ "\n Calculations Results ")
- (princ "\n")
- (if (eq k "A")
- (progn
- (princ "\n Type 1: ")
- (princ
- (strcat
- (rtos (/ (* (- (expt (+ (sqrt a) 1) 2) a) l 0.25) (sqrt a))
- 2
- 2
- )
- "sq.m"
- )
- )
- )
- (progn
- (princ "\nType 2: ")
- (princ
- (strcat
- (rtos (/ (* (- (expt (+ (sqrt a) 4) 2) a) l 0.25) (sqrt a))
- 2
- 2
- )
- " sq.m"
- )
- )
- )
- )
- (princ "\n Type 3: ")
- (princ (strcat (rtos (* a 0.1) 2 2) " sq.m"))
- )
- )
- (princ)
- )
如果我选择[A]类型1(例如)print toy me
类型1=。。。。平方米
类型3=。。。。平方米
以同样的方式
如果我选择类型2(例如),请打印toy me
类型2=。。。。平方米
类型3=。。。。平方米
我只需要打印这个
对于[A]
如果类型1>类型3,则仅打印类型3
如果类型1
如果我选择
如果类型2>类型3,则仅打印类型3
如果类型2
有人能帮我吗? |