CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoLISP 开发指南

示例:将英寸转换为米(AutoLISP)

2023-1-6 12:15| 发布者: admin| 查看: 724| 评论: 0|来自: AutoCAD

摘要: 此示例演示如何使用 cvunit 函数将用户指定的距离(以英寸为单位)转换为米。

此示例演示如何使用函数将用户指定的以英寸为单位的距离转换为米。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)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

AutoCAD VBA参数化绘图程序开发与实战

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-6 19:20

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部