ftsg.net
当前位置:首页 >> lisp AssoC >>

lisp AssoC

AutoLISP语言是在普通的LISP语言基础上,又扩充了许多适用于CAD应用的功能而形成的一种程序设计语言。它是一种解释性求值语言,速度较慢,难以保密,可用任何文字编辑软件编辑,用纯文本的格式保存。例如: (setq i 1);就是代码i值是1 (command ...

加循环 (setq el (car (entsel))) (foreach n (entget el) (if (= 10 (car n)) (setq ptlist (cons (cdr n) ptlist)) ) )

文字内容代码为1 (defun c:b1() (setq gj_list_32 (entget (car (entsel))) gj_text_old_32 (assoc 1 gj_list_32) gj_text_new_32 (cons 1 "%%1308@200(2)") ;用于8间距200,一级钢 gj_list_32 (subst gj_text_new_32 gj_text_old_32 gj_list_32...

;量取直线、多段线、样条曲线、圆虎圆、椭圆的长度 (defun c:cdcl() (setq cm (getvar "cmdecho")) (setvar "cmdecho" 0) (while (setq ent (car (entsel "\n选取多段线:"))) (setq dxf (entget ent) nam (cdr (assoc 0 dxf)) ) (if (wcmatch na...

(setq #k1 (entget &k1));&k1为对象,取得属性列表 (setq %k1 (cdr (assoc 70 #k1));%k1为是否封闭值1为封闭,0为不封闭 (setq %k2 (cdr (assoc 62 #k1));如果值为nil,就表示颜色为 ByLayer颜色,如果有数值就表示别的颜色。 如果要检查数值的...

(defun c:tt (/ JU LU XI) (setvar "cmdecho" 0) (defun table (s / d r) (while (setq d (tblnext s (null d))) (setq r (cons (cdr (assoc 2 d)) r)) ) ) (princ "\n功能 [修改图层名称]") (setqju (getstring "\n输入旧图层名:") xi (getstri...

(defun c:sd() (setq oldcm (getvar "cmdecho") oldos (getvar "osmode") ) (setvar "cmdecho" 0) (setvar "osmode" 33) (command "_undo" "be") (if (setq p1 (getpoint "\n指定第一点p1:")) (if (setq p2 (getpoint p1 "\n指定第二点p2:")) (p...

;程序写了一个,选择圆,然后选择圆外一点,得到的图形如下 (defun C:tes ( / #k1 #os1 &r1 &tc1 ang1 ent1 ent2 ob1 ob2 pt1 pt2 pt3 x) (setvar "cmdecho" 0) (setvar "blipmode" 0) (vl-load-com) ;;加载vlax扩展函数 (setq #os1 (getvar "os...

(defun C:WZ ( / n ss &kw L ff %k %k1 %k2 %k3 %k4 %k5 %k6);批量选择文字到记事本 (setvar "cmdecho" 0) ;;关闭变量 (setvar "blipmode" 0);;关闭控制点 (vl-load-com) ;;加载vlax扩展函数 (setq n 0 ss '()) ;;取得一个空表 (princ "\n请选择...

;返回直线段的中点 ;用法: (ptmid 直线段图元) (defun ptmid(Xent) (setq dxf (entget Xent) p10 (cdr (assco 10 dxf)) p11 (cdr (assoc 11 dxf)) mid (mapcar '* '(0.5 0.5 0.5) (mapcar '+ p10 p11)) ) )

网站首页 | 网站地图
All rights reserved Powered by www.ftsg.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com