cad使用lisp

更新时间:2023-06-05 06:08:41 阅读: 评论:0

【累计长度cd】
(DEFUN C:cd ()
  (tq tot_len 0) 
  (prompt "\nSelect all objects to count请选择所有要累计长度的物体: ")
(tq ss (ssget))
  (while (> (sslength ss) 0)
    (tq en (ssname ss 0))
suffer from
    (tq ed (entget en))
    (tq e_type (cdr (assoc '0 ed)))
    (cond
      ((= e_type "LINE") (add_lines))
      ((= e_type "ARC") (add_arcs))
      ((= e_type "POLYLINE") (add_poly))
      ((or
    (/= e_type "LINE")
    (/= e_type "ARC")
    (/= e_type "POLYLINE")
      )
      (ssdel en ss)
      )环球北美考试院
    )
  )
  (prompt (strcat "\nTotal length is 总长度是: " (rtos tot_len 2 2)))
)
(princ)
【焊缝hf】
;;; WELDn.LSP
;;; Date        :  28 June 1995
;;; Description :  Draws welding symbol
;;; bong c. deato property for Tostem HK Ltd.
;;; 2.00
;;; revi 03 July 1996: add sideweld option
;;; 2.01
;;; revi 17 September 1996 : add UCS World command to fit all ucs
;;; 2.02
;;; revi 15 July 1997 : change the weld-plan routine
;;; 3.00
;;; by Eric Wong
(defun C:hf (/ old cmdold lyold)
  (tq old *error*)
  (defun *error* (msg)
      (if
        (or
          (/= msg "Function cancelled")
          (= msg "quit / exit abort")
        )
        (princ)
        (princ (strcat "\nError: " msg))
      )
      (tq *error* old)
      (tq old nil ba nil cmdold nil lyold nil)
      (princ)
  );defun error
  (tq cmdold (getvar "cmdecho"))
  (tq lyold (getvar "clayer"))
  (prompt "\nWELD.lsp  Version 3.00")
  (tvar "CMDECHO" 0)
  (princ)
;;; default value routine
  (if (= wsz nil) (tq wsz 4.0))
  (princ (strcat "\nWelding size <" (rtos wsz 2 2) ">: "))
  (tq a (getdist))
nator
  (if (= a nil) (tq a wsz))
  (tq wsz a)
  (initget "Sideweld Planweld")
  (tq lect (getkword "\nSideweld/<Planweld>: "))
  (if (= lect "Sideweld")(weld_ct)(weld_plan))
  (tq old nil)
  (tvar "CMDECHO" CMDOLD)
  (tvar "blipmode" 0)
  (tvar "clayer" lyold)
  (princ)
关于健康的英语手抄报
); end
;;;-------------------------------------------------------------
;;; weldn ction routine
(defun weld_ct (/ ipt weld-lay)
太平洋英语  (tvar "blipmode" 1)
  (tq ipt (getpoint "\n Inrtion point: "))
  (tq weld-lay (tblarch "layer" "PUB_HATCH"))
        (if (= weld-lay nil)
            (command ".layer" "M" "PUB_HATCH" "c" "6" "" "")
        (tvar "clayer" "PUB_HATCH")
        )
ctm是什么
  (command ".inrt" "welds" ipt wsz "" pau)
  (command ".explode" (entlast))
  (command ".chprop" "p" "" "la" "PUB_HATCH" "")verve
)
;;; new weld plan routine
(defun weld_plan ();(/ pt1 pt2 pt3 pt4 weld-l weld-n weld-ang)
  (if (= (tblarch "layer" "PUB_HATCH") nil)
      (command ".layer" "M" "PUB_HATCH" "c" "6" "" "")
      (tvar "clayer" "PUB_HATCH")6684
  )
  (tvar "blipmode" 1)
  (command "ucs" "w")
  (princ "\nPick points in clockwi rotation.")kenwood
  (tq pt1 (getpoint "\nFrist point :")
    pt2 (getpoint pt1 "\nSecond point :")
    weld-l (distance pt1 pt2)
    weld-n (fix (/ weld-l wsz))
    weld-ang (angle pt1 pt2)
    pt3 pt1
  )
  (command ".pline" pt1 "a")
  (repeat (- weld-n 2)
    (command "ce" (tq pt4 (polar pt3 weld-ang wsz)) "a" "-120")
    (command "d" pt3 pt4)
    (tq pt3 pt4)
  )
  (command "ce" (tq pt4 (polar pt3 weld-ang wsz)) "a" "-180" "")
  (command "ucs" "p")
); end weld_plan
(princ "\nready to welding\n")
(princ)
【点坐标】
(defun c:vf ()
    (command "osmode" "513")   
    (SEtQ POINT1 (GETPOINT "/n点1"))
    (command "osmode" "0")     
    (tq yy1 (cadr POINT1))
    (tq zz1 (caddr POINT1))
    (tq A1 (ITOA (fiX  yy1)))
    (tq A2 (ITOA (fiX  zz1)))
    (tq a (STRCAT "屋面" A1 " " "幕墙"  A2 " "))
    (command"text" POINT1 "400" "0" a /n)
    (tq a (entlast))
    (command "change" a "" "p" "la" "装饰面进出位"  "c" "bylayer" "")
    (command "osmode" "673")
)
 
(defun c:q1 ()
    (command "ucs" "")
    (command "osmode" "513")   
    (SEtQ POINT1 (GETPOINT "/n点1"))
    (command "osmode" "0")
    (tq xx1 (car POINT1))     
    (tq yy1 (cadr POINT1))
    (tq zz1 (caddr POINT1))
    (tq A1 (ITOA (fiX  xx1)))
    (tq A2 (ITOA (fiX  yy1)))
    (tq A3 (ITOA (fiX  zz1)))
春节小品大全
    (tq a (STRCAT "X=" A1 " " "Y="  A2 " " "Z=" a3 " "))
    (command"text" POINT1 "400" "0" a /n)
    (tq a (entlast))
    (command "change" a "" "p" "la" "坐标点"  "c" "bylayer" "")
    (command "osmode" "673")
)
 

本文发布于:2023-06-05 06:08:41,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/134463.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:长度   累计   考试院   进出
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图