重量计算
为什么我在这个lisp中得到这个错误消息?未知命令“N”。按F1键获取帮助。
未知命令“VV”。按F1键获取帮助。
;;;Vv - Calculates the weight a steelplate based on given in of plate thickness and a hatch or polyline object.
:::Using a mass proberties of 7850 kg/m3 of steel plate.
(defun c:vv ( / oldlayer oldcmdecho oldosnap ctextstyle fae thk wgt frar frarr fwgt fwgtm far farsf fip )
(setvar "OSMODE" 0)
(setvar "cmdecho" 0)
(setq oldlayer (getvar "clayer"))
(setq oldcmdecho (getvar "cmdecho"))
(setq oldosnap (getvar "osmode"))
(setq ctextstyle (getvar "textstyle"))
(Command "-style" "WEIGHT" "ISOCP.shx" "3.5" "1" "0" "n" "n" "n")
(if (not (tblsearch "LAYER" "AM_WEIGHT"))
(Command "-layer" "n" "AM_WEIGHT" "c" "6" "AM_WEIGHT" "s" "AM_WEIGHT" "P" "N" "AM_WEIGHT" "")
(setvar "clayer" "AM_WEIGHT"))
(command "-color" "BYLAYER" "")
(prompt "\nChoose Polyline or Hatch for area and weight calculation: ")
(setq fae (car (entsel)))
(Command "area" "e" fae)
(setq thk (getreal "\nThickness of plate? in mm: "))
(setq wgt (* thk 7850))
(setq frar (/ (getvar "area") 1))
(setq frarr (/ (getvar "area") 1000000))
(setq fwgt (* frarr wgt))
(setq fwgtm (/ fwgt 1000))
(setq far (rtos fwgtm 2 4))
(setq farsf (strcat "Plate thickness = " (rtos thk 2 2) "mm. -- Area =" (rtos frar 2 4) " mm2. -- Area =" (rtos frarr 2 4) " m2. -- weight = " far " kg./plate"))
(setq fip (getpoint "\nChoose Text Insert Point:"))
(Command "text" "s" "WEIGHT" "j" "MC" fip "45" farsf)
(command "-layer" "s" oldlayer "")
(command "-color" "BYLAYER" "")
(setvar "TEXTSTYLE" ctextstyle)
(setvar "OSMODE" oldosnap)
(setvar "CMDECHO" oldcmdecho)
(princ)
)
Thx提前! 从这里开始(见下面的彩色代码):
只需要2“n”英寸。。。“-风格”。。。
(命令“-color”末尾没有“”。。。 非常感谢。。。为了快速回复
页:
[1]