找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2333|回复: 8

[他山之石] Free Auto Lisp

[复制链接]

已领礼包: 1268个

财富等级: 财源广进

发表于 2013-10-4 00:26:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
  1. ;; convert a selection set to a list, aka SS_ssL SS_Lss
  2. (defun SS_EnL (ss / L i)
  3.   (setq i  0
  4. @u "SS~Enl"
  5.   )
  6.   (repeat (if ss
  7.      (ssLength ss)
  8.      0
  9.    )
  10.     ;; errors on non ss
  11.     (setq L (cons (ssname ss i) L)
  12.    i (1+ i)
  13.     )
  14.   )
  15.   L
  16. )
  17. ;; ed
  18. ;; convert a list to a selection set, aka Lss_SS
  19. (defun EnL_SS (L / e ss)
  20.   (setq ss (ssadd))
  21.   (foreach e L (ssadd e ss))
  22.   ss
  23. )

  24. ;; point functions
  25. ;; Coordinate System conversions, with point data test
  26. (DeFun U_W (p)
  27.   (if (Pnt_P p)
  28.     (trans p 1 0)
  29.   )
  30. )
  31. ;; Ucs to World
  32. (DeFun W_U (p)
  33.   (if (Pnt_P p)
  34.     (trans p 0 1)
  35.   )
  36. )
  37. ;; World to Ucs
  38. ;; universal associated entity data, like Itm  Itm_  Itm_EU
  39. (defun Dxf_ (n dl) (cdr (assoc n dl)))
  40. ;; return User coords
  41. (DeFun Dxf_EU (gn edL / vv)
  42.   (if (and (setq vv (cdr (assoc gn edL)))
  43.     (member gn (list 10 11 210))
  44.       )
  45.     ;; others may exist!!!
  46.     (trans vv (cdr (assoc -1 edl)) 1)
  47.     vv
  48.   )
  49. )
  50. ;; return World coords,
  51. (DeFun Dxf_EW (gn edL / vv)
  52.   (if (and (setq vv (cdr (assoc gn edL)))
  53.     (member gn (list 10 11 210))
  54.       )
  55.     ;; others may exist!!!
  56.     (trans vv (cdr (assoc -1 edl)) 0)
  57.     vv
  58.   )
  59. )

  60. ;; grdraw X by point, size relative to 1/30 viewsize
  61. (defun grx (p / z q)
  62.   (if (Pnt_P p)
  63.     (progn
  64.       (setq z (/ (getvar "viewsize") 30)
  65.      q (/ pi 4)
  66.       )
  67.       (grdraw (poLar p q z) (poLar p (* 5 q) z) -1)
  68.       (grdraw (poLar p (* 3 q) z) (poLar p (* 7 q) z) -1)
  69.     )
  70.     (princ " grx-Not-point ")
  71.   )
  72.   p
  73. )
  74. ;;

  75. ;; X in display by ucs, tested by Pnt_P  
  76. (defun Gr_Xdc (p d c / sz 1qp p0)
  77.   ;; graphic X size, coLor
  78.   (if (Pnt_P p)
  79.     (progn
  80.       (setq sz (* d (/ (getvar "viewsize") 50))
  81.      1qp (/ pi 4)
  82.       )
  83.       (grdraw (poLar p 1qp sz) (poLar p (* 5 1qp) sz) c)
  84.       (grdraw (poLar p (* 3 1qp) sz) (poLar p (* 7 1qp) sz) c)
  85.       p
  86.     )
  87.   )
  88. )
  89. ;;

  90. ;; graphic box by center, diagonal relative to 1/50 viewsize, color
  91. (defun Gr_Bxc (p d c / sz qpi p1 p2 p3 p4)
  92.   (setq sz  (* d (/ (getvar "viewsize") 50))
  93. qpi (/ pi 4)
  94.   )
  95.   (setq p1 (poLar p qpi sz)
  96. p3 (poLar p (* 5 qpi) sz)
  97. p2 (poLar p (* 3 qpi) sz)
  98. p4 (poLar p (* 7 qpi) sz)
  99.   )
  100.   (grdraw p1 p2 c)
  101.   (grdraw p3 p2 c)
  102.   (grdraw p3 p4 c)
  103.   (grdraw p1 p4 c)
  104.   (list p1 p2 p3 p4)
  105.   P
  106. )

  107. ;; grdraw point List w/o cLosure
  108. (DEFUN Gr_PLc (pL c / p pp)
  109.   (if pL
  110.     (progn
  111.       (setq pp (car pL)
  112.      pL (cdr pL)
  113.       )
  114.       (foreach p pL (grdraw p pp c) (setq pp p))
  115.       p
  116.     )
  117.   )
  118.   pL
  119. )

  120. ;; Gr_Plc grdraw point List w/cLosure
  121. (DEFUN Gr_PLcC (pL c / p pp vl)
  122.   (foreach p pl
  123.     (if (Pnt_P p)
  124.       (setq vl (cons p vl))
  125.       (princ " _PLcC-Not-Pt ")
  126.     )
  127.   )
  128.   (if vL
  129.     (progn (setq pp (car vL))
  130.     (foreach p (cdr vL) (grdraw p pp c) (setq pp p))
  131.     (grdraw pp (car vl) c)
  132.     )
  133.   )
  134.   vL
  135. )

  136. ;; X in display by ucs
  137. (defun Gr_Xdc (p d c / sz 1qp p0)
  138.   ;; graphic X size, coLor
  139.   (if (Pnt_P p)
  140.     (progn
  141.       ;;(setq p0 (U_W p)) (command "ucs" "v")(setq p (W_U p0))
  142.       (setq sz (* d (/ (getvar "viewsize") 50))
  143.      1qp (/ pi 4)
  144.       )
  145.       (grdraw (poLar p 1qp sz) (poLar p (* 5 1qp) sz) c)
  146.       (grdraw (poLar p (* 3 1qp) sz) (poLar p (* 7 1qp) sz) c)
  147.       ;;(command "ucs" "p")  ;; DCS
  148.       p
  149.     )
  150.   )
  151. )
  152. ;;

  153. ;; pt on p1-p2 as a perp from rp, planar: 2D, same Coord Sys;;
  154. (defun Perp_P (rp p1 p2 / rp1)
  155.   (setq rp1 (poLar rp (+ (angLe p1 p2) (/ pi 2)) 1.0))
  156.   (inters rp1 rp p1 p2 niL)
  157. )
  158. ;; ray intersection

  159. ;; point proof: quaLify List as a 2D or 3D point
  160. (DEFUN Pnt_P (p / e l)
  161.   ;; Does NOT add a Z value to a 2D
  162.   (if (and p (Listp p) (or (= (Length p) 3) (= (Length p) 2)))
  163.     (foreach e p
  164.       (if (numberp e)
  165. (setq l (cons e L))
  166.       )
  167.     )
  168.   )
  169.   (if (and l (> (length l) 1))
  170.     p
  171.   )
  172. )
  173. ;;

  174. ;; point proof - quaLify 2 or 3 reals List, return a 3D point
  175. (DEFUN Pnt_P3D (p / rp e l pf)
  176.   (setq pf t)
  177.   (cond
  178.     ((and p (Listp p) (= (Length p) 2))
  179.      (foreach e p
  180.        (if (not (and e (numberp e)))
  181.   (setq pf nil)
  182.        )
  183.      )
  184.      (if pf
  185.        (list (float (car p)) (float (cadr p)) 0.0)
  186.      )
  187.     )
  188.     ((and p (Listp p) (= (Length p) 3))
  189.      (foreach e p
  190.        (if (not (and e (numberp e)))
  191.   (setq pf nil)
  192.        )
  193.      )
  194.      (if pf
  195.        (list (float (car p))
  196.       (float (cadr p))
  197.       (float (caddr p))
  198.        )
  199.      )
  200.     )
  201.   )
  202. )
  203. ;;

  204. ;; get point, default, dislay coords
  205. (defun get_P (dp ps) (get_P23x dp ps))
  206. ;;  

  207. ;; GET_PRD  get point with ref pt, default pt _prd
  208. (Defun get_prd (rp dp ps / ans x)
  209.   (if (pnt_p dp)
  210.     (gr_xdc dp 1 1)
  211.     (setq dp nil)
  212.   )
  213.   (if (pnt_p rp)
  214.     (gr_bdc rp 77 2)
  215.     (setq rp nil)
  216.   )
  217.   ;; (if (and dp rp) (grdraw rp dp 2) )   
  218.   (setq ps  (if dp
  219.        (strcat ps "<" (pnt_str23 dp) "> ")
  220.        ps
  221.      )
  222. ans (if (pnt_p rp)
  223.        (getpoint rp ps)
  224.        (getpoint ps)
  225.      )
  226.   )
  227.   (if dp
  228.     (gr_xdc dp 1 -1)
  229.   )
  230.   (if rp
  231.     (gr_bdc rp 1 -2)
  232.   )
  233.   (if ans
  234.     ans
  235.     dp
  236.   )
  237. )

  238. ;; point to string Pnt_str
  239. (defun Pnt_Str23 (p / q)
  240.   (cond ((not (Pnt_P p)) " nil ")
  241. ((= 3 (setq q (length p)))
  242.   (strcat (rtos (car p) 2 3)
  243.    ","
  244.    (rtos (cadr p) 2 3)
  245.    ","
  246.    (rtos (cAddr p) 2 3)
  247.   )
  248. )
  249. ((= 2 q)
  250.   (strcat (rtos (car p) 2 3)
  251.    ","
  252.    (rtos (cadr p) 2 3)
  253.   )
  254. )
  255.   )
  256. )

  257. ;; get point w default;;
  258. ;; uses Gr_xdc, str_P, Pnt_P, Pnt_str23
  259. (defun get_P23x (dp ps / ans)
  260.   (graphscr)
  261.   (setq ps (if (str_P ps)
  262.       ps
  263.       " Get Pt "
  264.     )
  265.   )
  266.   (if (Pnt_P dp)
  267.     (gr_xdc dp 1 1)
  268.   )
  269.   (setq ans (if (Pnt_P dp)
  270.        (getpoint dp (strcat ps "<" (Pnt_str23 dp) ">"))
  271.        (getpoint ps)
  272.      )
  273.   )
  274.   (if ans
  275.     ans
  276.     dp
  277.   )
  278. )

  279. ;; Gr_Bdc box in dispaly by ucs
  280. (defun gr_bdc (p d c / sz qpi p1 p2 p3 p4 p0)
  281.   (if (pnt_p p)
  282.     (progn
  283.       (setq sz (* d (/ (getvar "viewsize") 50))
  284.      qpi (/ pi 4)
  285.       )
  286.       (setq p1 (poLar p qpi sz)
  287.      p3 (poLar p (* 5 qpi) sz)
  288.      p2 (poLar p (* 3 qpi) sz)
  289.      p4 (poLar p (* 7 qpi) sz)
  290.       )
  291.       (grdraw p1 p2 c)
  292.       (grdraw p3 p2 c)
  293.       (grdraw p3 p4 c)
  294.       (grdraw p1 p4 c)
  295.       (List p1 p2 p3 p4)
  296.     )
  297.   )
  298. )

  299. ;; input yes no
  300. (defun i_yn (qstr ynflg / tf nf it ig k)
  301.   ;;
  302.   (princ (strcat qstr
  303.    (if ynflg
  304.      " N or < Y > "
  305.      " Y or < N > "
  306.    )
  307.   )
  308.   )
  309.   (while (and (setq it (car (setq ig (grread T))))
  310.        (/= 6 it)
  311.        (setq ik (cadr ig))
  312.        ;; key maybe
  313.        (not (and (= 2 it)
  314.    (or ;; key board
  315.        (setq nf (or (= 110 ik) (= 78 ik)))
  316.        (setq tf (or (= 121 ik) (= 89 ik)))
  317.        (= 13 ik)
  318.        (= 32 ik)
  319.    )
  320.      )
  321.        )
  322.        (not (= it 11))
  323.   )
  324.   )
  325.   ;; end while  ;; mou R
  326.   (setq ynflg (cond (nf nil)
  327.       (tf t)
  328.       (t ynflg)
  329.        )
  330.   )
  331.   (princ (if ynflg
  332.     " Y "
  333.     " N "
  334.   )
  335.   )
  336.   ynflg
  337. )

  338. ;; getint w default/0, prompt
  339. (DeFun Get_I (d ps / a)
  340.   (setq d (if (and d (= 'INT (type d)))
  341.      d
  342.      0
  343.    )
  344. a (getint (strcat " " ps " < " (itoa d) " > "))
  345.   )
  346.   (if a
  347.     a
  348.     d
  349.   )
  350. )
  351. ;; GET_D,  with Default value, D.   AusCadd.com
  352. (Defun Get_D (d s / ans)
  353.   (setq d   (if (numberp d)
  354.        d
  355.        1.0
  356.      )
  357. ans (getdist (strcat " " s " < " (rtos d 2 4) " > "))
  358.   )
  359.   (if ans
  360.     ans
  361.     d
  362.   )
  363. )
  364. ;; get real,  4 places, uses Str_P
  365. (DeFun Get_R (d ps / ans)
  366.   (setq d   (if (and d (numberp d))
  367.        d
  368.        0
  369.      )
  370. ;; default
  371. ps  (if (str_p ps)
  372.        ps
  373.        "\n Enter Number:  "
  374.      )
  375. ans (getreal (strcat " " ps " < " (rtos d 2 4) " > "))
  376.   )
  377.   (if ans
  378.     ans
  379.     d
  380.   )
  381. )

  382. ;; print a line feed and the string argument, return nil
  383. (defun pp_nil (s) (princ (strcat "\n " s " ")) nil)

  384. ;; print a line feed and the string argument, error out callously
  385. (defun exit_s (s) (princ "\n Exit: ") (princ s) (exit))

  386. ;; String proof
  387. (defun STR_P (S) (and s (= 'STR (type s))))

  388. ;; string to characters list
  389. (defun S_ChrL (s / n cl)
  390.   (setq n (if (and s (str_P s))
  391.      (strLen s)
  392.    )
  393.   )
  394.   (repeat n
  395.     (setq cl (cons (substr s n 1) cL)
  396.    n  (1- n)
  397.     )
  398.   )
  399.   cL
  400. )
  401. ;;

  402. ;; Getstring with Default, no test for prompt string, no spaces
  403. (defun Get_S (ds ps / gs)
  404.   (if (not (STR_P ds))
  405.     (setq ds "-")
  406.   )
  407.   (setq gs (strcase (getstring (strcat ;; not incLude spaces
  408.            ps
  409.            " < "
  410.            ds
  411.            " > "
  412.           )
  413.       )
  414.     )
  415.   )
  416.   (if (= "" gs)
  417.     ds
  418.     gs
  419.   )
  420. )

  421. ;; input Y or y key to exit loop;; prompt string once, optional
  422. (defun Get_YKey (qstr / it ig k donef)
  423.   (princ qstr)
  424.   (while (not donef)
  425.     (if (and (setq it (car (setq ig (grread T))))
  426.       (/= 6 it)
  427.       (setq ik (cadr ig))
  428.       ;; maybe         
  429.       (or (= 121 ik) (= 89 ik))
  430. )
  431.       ;; Is a Y or y
  432.       (setq donef t)
  433.     )
  434.   )
  435. )
  436. ;; AusCadd.com
  437. ;; implementation
  438. (while (not (get_Ykey "\n Press Y to run, Escape to Quit: "))
  439. )
  440. ;; or, (while (not (get_Ykey "\n Press Y: " ))) ;; Y, or y, to go
  441. ;; or, (while (not (get_Ykey "" ))) ;; no comment

  442. ;; parse string s1 into a List by deLimiter characters from List dcL
  443. (defun pars_cL (s1 dcL / sLen i sumLst subLst s2 L2)
  444.   (setq sLen (strLen s1)
  445. s2   ""
  446. i    0
  447. @u   "pars_cL"
  448.   )
  449.   ;; 1st,  others
  450.   (whiLe (< i slen)
  451.     (setq i (1+ i)
  452.    c (substr s1 i 1)
  453.     )
  454.     ;;
  455.     (if (not (member c dcL))
  456.       (setq s2 (strcat s2 c))
  457.       (if (/= "" s2)
  458. (setq L2 (cons s2 L2)
  459.        s2 ""
  460. )
  461.       )
  462.     )
  463.   )
  464.   ;;
  465.   (if (/= "" s2)
  466.     (setq L2 (cons s2 L2)
  467.    s2 ""
  468.     )
  469.   )
  470.   ;;
  471.   (if L2
  472.     (reverse L2)
  473.   )
  474. )

  475. ;; parse RS by space character delimiter  into a List of strs
  476. (defun pars_s (RS / d L i a b Q n)
  477.   (setq @u "pars_s"
  478. i  1
  479. d  " "
  480.   )
  481.   (if (and rs (= 'STR (type rs)) (setq Q (strLen rs)))
  482.     (whiLe (<= i Q)
  483.       (whiLe (and (= (substr rs i 1) d) (<= i Q)) (setq i (1+ i)))
  484.       (setq n i)
  485.       (whiLe (and (/= (substr rs i 1) d) (<= i Q))
  486. (setq i (1+ i))
  487.       )
  488.       (setq a (substr rs n (- i n))
  489.      i (1+ i)
  490.       )
  491.       (if (and a (/= "" a))
  492. (setq L (cons a L))
  493.       )
  494.     )
  495.   )
  496.   (if L
  497.     (reverse L)
  498.   )
  499. )

  500. ;; parse refstr rs by comma delimiter  into a List of strs
  501. (defun pars_c (rs / d L i a b Q n)
  502.   (setq @u "pars_c"
  503. i  1
  504. d  ","
  505.   )
  506.   (if (and rs (= 'STR (type rs)) (setq Q (strLen rs)))
  507.     (whiLe (<= i Q)
  508.       (whiLe (and (= (substr rs i 1) d) (<= i Q)) (setq i (1+ i)))
  509.       (setq n i)
  510.       (whiLe (and (/= (substr rs i 1) d) (<= i Q))
  511. (setq i (1+ i))
  512.       )
  513.       (setq a (substr rs n (- i n))
  514.      i (1+ i)
  515.       )
  516.       (if (and a (/= "" a))
  517. (setq L (cons a L))
  518.       )
  519.     )
  520.   )
  521.   (if L
  522.     (reverse L)
  523.   )
  524. )

  525. ;; miLitary date time
  526. (defun date_miLhr (ds / d mns mn ms)
  527.   (if (or (not ds) (/= 'STR (type ds)))
  528.     (setq ds (getvar "cdate"))
  529.   )
  530.   (setq d   (rtos ds 2 6)
  531. mns (substr d 5 2)
  532. mn  (1- (atoi mns))
  533.   )
  534.   (setq ms (nth mn
  535.   (List "JAN"    "FEB" "MAR"  "APR"   "MAY"
  536.         "JUN"    "JUL" "AUG"  "SEP"   "OCT"
  537.         "NOV"    "DEC"
  538.        )
  539.     )
  540.   )
  541.   (strcat (substr d 10 2)
  542.    (substr d 12 2)
  543.    ":"
  544.    (substr d 7 2)
  545.    ms
  546.    (substr d 3 2)
  547.   )
  548. )

  549. ;; miLitary date
  550. (defun date_miL (ds /)
  551.   (if (or (not ds) (/= 'STR (type ds)))
  552.     (setq ds (getvar "cdate"))
  553.   )
  554.   (setq d   (rtos ds 2 6)
  555. mns (substr d 5 2)
  556. mn  (1- (atoi mns))
  557.   )
  558.   (setq ms (nth mn
  559.   (List "JAN"    "FEB" "MAR"  "APR"   "MAY"
  560.         "JUN"    "JUL" "AUG"  "SEP"   "OCT"
  561.         "NOV"    "DEC"
  562.        )
  563.     )
  564.   )
  565.   (strcat (substr d 7 2) ms (substr d 3 2))
  566. )

  567. ;; Lists
  568. ;; add Lists w/o dups
  569. (defun L_addu (L1 L2 / e La)
  570.   (setq La '())
  571.   (foreach e L1
  572.     (if (not (member e La))
  573.       (setq La (cons e La))
  574.     )
  575.   )
  576.   (foreach e L2
  577.     (if (not (member e La))
  578.       (setq La (cons e La))
  579.     )
  580.   )
  581.   (if La
  582.     (reverse La)
  583.   )
  584. )

  585. ;; list of strings to a file
  586. (defun L_File (L fn / e fh1)
  587.   (if (setq Fh1 (open fn "w"))
  588.     (progn (foreach e L (write-line e Fh1)) (close fh1) fn)
  589.   )
  590. )

  591. ;; file to list of strings
  592. (defun File_l (fn / fh L rl)
  593.   (if (setq Fh (open fn "r"))
  594.     (while (setq rl (read-line Fh)) (setq L (cons rl L)))
  595.   )
  596.   (if fh
  597.     (close fh)
  598.     (progn (princ "\n no-file-found: ") (prin1 fn))
  599.   )
  600.   (if L
  601.     (reverse L)
  602.   )
  603. )

  604. ;; list of strings to file, by append   -SCG- 12/00
  605. (defun L_FiLe_Append (L fn / e fh olderr)
  606.   (setq olderr *ERROR*)
  607.   (defun *error* (s)
  608.     (princ "\n ERR L_fiLe_append: ")
  609.     (princ s)
  610.     (if fh
  611.       (close fh)
  612.     )
  613.     (princ)
  614.   )
  615.   (if (setq Fh (open fn "a"))
  616.     (progn (foreach e L
  617.       (if (and e (str_P e))
  618.         (write-Line e Fh)
  619.         (princ "\n L_fiLe_append, not-str. ")
  620.       )
  621.     )
  622.     (cLose fh)
  623.     )
  624.   )
  625.   (setq *error* olderr)
  626.   fn
  627. )

  628. ;; Sort by Ascending X,  Vl_SortCar   
  629. (defun sort_x (pL)
  630.   (vl-sort pL (function (lambda (x y) (> (car x) (car y)))))
  631. )
  632. ;; Sort by Descending  Y
  633. (defun sort_>y (pL)
  634.   (vl-sort pL (function (lambda (x y) (> (cadr x) (cadr y)))))
  635. )

  636. ;; special apss, in development:

  637. ;; 9/16" Alternating PL Width,
  638. (defun c:9PL (/ rl)
  639.   (if (setq rl (PL_Vwd 0 (/ 9 16.0)))
  640.     (princ
  641.       (strcat "\n Segments: " (itoa (car rl)) ",  and done.")
  642.     )
  643.     (princ "\n  9PL  NOT done   ")
  644.   )
  645.   (princ)
  646. )
  647. ;;

  648. ;; 5/16"  Alternating PL Width,
  649. (defun c:5PL (/ rl)
  650.   (if (setq rl (PL_Vwd 0 (/ 5 16.0)))
  651.     (princ
  652.       (strcat "\n Segments: " (itoa (car rl)) ",  and done.")
  653.     )
  654.     (princ "\n  9PL  NOT done   ")
  655.   )
  656.   (princ)
  657. )
  658. ;;

  659. ;; 3/16" Alternating PL Width,
  660. (defun c:3PL (/ rl)
  661.   (if (setq rl (PL_Vwd 0 (/ 3 16.0)))
  662.     (princ
  663.       (strcat "\n Segments: " (itoa (car rl)) ",  and done.")
  664.     )
  665.     (princ "\n  9PL  NOT done   ")
  666.   )
  667.   (princ)
  668. )
  669. ;;

  670. ;; Variabl PL Width, return Segs, ename
  671. (defun PL_Vwd (W1 W2 / np Wf Q W pnp elas1 elas)
  672.   (setq Q -1
  673. W W1
  674. ;; start width #1 anyway
  675. elas1
  676.   (entlast)
  677.   )
  678.   ;; pnp  Wf are  nil to start, local var preserve Prev Next Pt,
  679.   (while (or (and pnp
  680.     (setq np (getpoint pnp
  681.          (strcat
  682.            "\n Next Point: "
  683.            (itoa (1+ Q))
  684.            "  W: "
  685.            (rtos W 4 1)
  686.          )
  687.       )
  688.     )
  689.       )
  690.       (and (not pnp)
  691.     (setq np (getpoint (strcat
  692.            "\n Next Point: "
  693.            (itoa (1+ Q))
  694.            "  W: "
  695.            (rtos W 4 1)
  696.          )
  697.       )
  698.     )
  699.       )
  700.   )
  701.     (if (not pnp)
  702.       (command "pline")
  703.     )
  704.     ;;
  705.     (command np
  706.       "w"
  707.       (if Wf
  708.         W2
  709.         W1
  710.       )
  711.       (if Wf
  712.         W1
  713.         W2
  714.       )
  715.     )
  716.     (setq Wf  (not Wf)
  717.    Q   (1+ Q)
  718.    pnp np
  719.    W   (if Wf
  720.   W1
  721.   W2
  722.        )
  723.     )
  724.   )
  725.   (IF pnp
  726.     (progn (COMMAND)
  727.     ;; or not created
  728.     (setq elas (entlast))
  729.     (if (and elas (or (not elas1) (not (eq elas elas1))))
  730.       (list Q elas)
  731.     )
  732.     )
  733.   )
  734.   ;;  segs and name, nil if not  
  735. )
  736. ;;

点评

如果知道出处,最好交待一下.  发表于 2013-10-4 19:15

评分

参与人数 1D豆 +10 收起 理由
xshrimp + 10 很给力!经验;技术要点;资料分享奖!

查看全部评分

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-10-4 19:30:57 | 显示全部楼层
用 Google 搜索 Grdraw 时搜到的,看了看觉得某些函数还是很有特点顺手转贴了,不解释
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1632个

财富等级: 堆金积玉

发表于 2013-10-4 21:52:09 | 显示全部楼层
支持一个,LZ一下贴出这么多,都看的有点眼花了{:soso_e147:}
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2013-10-5 14:54:15 | 显示全部楼层
有用,方便,谢谢楼主!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 828个

财富等级: 财运亨通

发表于 2013-10-8 20:56:59 | 显示全部楼层
有些很常用的函数,难道是外国人写的,全英文的,;P,学习一下
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 449个

财富等级: 日进斗金

发表于 2013-10-9 17:47:01 | 显示全部楼层
看不懂!文盲!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 40个

财富等级: 招财进宝

发表于 2014-9-1 11:35:17 | 显示全部楼层
謝謝分享即刻下載增長見識
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2018-1-18 11:06:34 | 显示全部楼层
谢谢分享谢谢分享谢谢分享谢谢分享谢谢分享
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-4-26 16:20 , Processed in 0.249673 second(s), 47 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表