示例:将英寸转换为米 (AutoLISP) 
此示例演示如何使用该函数将用户指定的距离(以英寸为单位)转换为米。cvunit (defun C:I2M ( / eng_len metric_len eng metric)
  (princ "\nConverting inches to meters. ")
  (setq eng_len
  (getdist "\nEnter a distance in inches: "))
  (setq metric_len (cvunit eng_len "inches" "meters"))
  (setq eng (rtos eng_len 2 4)
           metric (rtos metric_len 2 4))
  (princ
    (strcat "\n\t" eng " inches = " metric " meters."))
 (princ)
)
    
父主题: | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 23:39
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.