|
;计算纸张类型和加长比
(defun K:GetPaperType (Num1 Num2 / Lenght Width PaperType PaperExt Round FVar)
(setq Lenght (max Num1 Num2));矩形长度
(setq Width (min Num1 Num2));矩形宽度
(setq PaperType
(/
(log (/ 1000000.0 (sqrt 2.0) (expt Width 2)))
(log 2.0)
)
);A几的纸张
(setq PaperExt (- Lenght (* (sqrt 2.0) Width) ));加长部分的长度
(setq Round (/ (* (sqrt 2) Width) 4.0));设置舍入容差
(Setq FVar (/ (fix (/ (+ PaperExt (* Round 0.5)) Round)) 4.0) );四舍五入加长部分的占比
(strcat "A" (rtos PaperType 2 0) "+" (rtos FVar 5 4))
) |
|