lzg8877 发表于 2022-4-7 15:24:41

求个小程序

      求个铝材挤压比的程序,请大师留步帮个忙,具体在附件里!先谢!先谢!

秋雨 发表于 2022-12-30 17:02:35

什么挤压比,看看

仲文玉 发表于 2023-3-24 14:11:30

路过,随手写的lsp,保存为*.lsp文件加载到CAD试试看

(defun c:tt(/ bjing en mj mzhong zc zjing zl)(vl-load-com)
(setqzjing(getint "-->输入铝棒直径:")bjing(* zjing 0.5) mzhong(rtos(* pi bjing bjing 0.0027)2 3))
(setq en(Vlax-Ename->Vla-Object(car(entsel "-->点选封闭图形:"))))
(setq mj(vlax-get en 'area) zc(rtos(vlax-get en 'length)2 3))
(setq zl(rtos(* mj 0.0027)2 3))
(princ"\n所选型材参数信息如下:")
(princ(strcat "\n型材周长:" zc "mm"))
(princ(strcat "\n截面积:"(rtos mj 2 3) "mm2"))
(princ(strcat "\n型材米重:" zl "kg/m"))
(princ(strcat "\n铝棒米重"(rtos bjing 2 2)"*"(rtos bjing 2 2)"*"(rtos pi 2 2)"*0.0027=" mzhong "kg/m"))
(princ(strcat "\n挤压比为=" mzhong "/" zl "="(rtos(/(atof mzhong)(atof zl))2 2)))
(princ)
)

页: [1]
查看完整版本: 求个小程序