明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1614|回复: 12

[资源] PressCAD注解输出的程序,LISP语言,自己编的其中之一功能

  [复制链接]
发表于 2021-3-27 16:50 | 显示全部楼层 |阅读模式
本帖最后由 qiannianhuazi 于 2021-3-31 19:34 编辑

自己编写的,对接另外的自编绘制程序,也可对接PESSCAD的
  1. (defun c:n222( / note2_ss11  note2_first_corner note2_other_corner textheight00 jg_zb_wza1 jg_zb_wza2 jg_zb_wza3 jg_zb_wza4
  2.                               jg_zb_wza5 jg_zb_wza6 jg_zb_wza7 jg_zb_wza8 jg_zb_wza9 jg_zb_wza10 jg_zb_wza11 jg_zb_wza12
  3.                               jg_zb_wza13 jg_zb_wza14 jg_zb_wza15 jg_zb_wzcgy jg_zb_wzdyx jg_zb_wzdyx1
  4.                               jg_ls_wz1 jg_ls_wz3 jg_ls_wz4 jg_ls_wz5 jg_ls_wz13 jg_ls_wz6 jg_ls_wz14 jg_ls_wz2 jg_ls_wzdyx
  5.                               jg_ls_wzdyx1 jg_ls_wz15 jg_ls_wz12 jg_ls_wz7 jg_ls_wz8 jg_ls_wz9 jg_ls_wz10 jg_ls_wzcgy jg_ls_wz11
  6.                               jg_ls_wz_all1
  7.                );;
  8.   (setvar "cmdecho" 0)
  9.   (SETVAR "osmode" 0)
  10.   (command "ucs" "w" "limits" "off")
  11.   (command "-style"  "standard" "txt.shx,gbcbig.shx" 0 0.8 0 "n" "n" "") ;;设置默认字体样式
  12.   (if(not (tblsearch "layer" "TEXT"))
  13.     (command "layer" "n" "TEXT" "C" "4" "TEXT" "")
  14.   )
  15.   (if(not (tblsearch "layer" "DIM"))
  16.     (command "layer" "n" "DIM" "C" "1" "DIM" "")
  17.   )
  18.   (command "layer" "on" "TEXT" "")
  19.   (command "layer" "on" "DIM" "")
  20.   (command "layer" "on" "0" "")
  21.   (prompt "\n ******输出加工注解程序,选取模板范围******")
  22.   (setq note2_first_corner (getpoint "\n >>>请点选模板的左下第一角点:"))
  23.   (setq note2_other_corner (getcorner note2_first_corner "\n >>>请点选模板的右上第二角点:"))
  24.   (if (= (type textheight) 'REAL)
  25.     (progn
  26.       (setq textheight00 (atof (getstring (strcat "\n >>>请输入标注文字高度<" (rtos textheight 2 0) ">:"))))
  27.       (if (or (= textheight00 nil)(= textheight00 "")(<= textheight00 0))
  28.          (setq textheight textheight)
  29.          (setq textheight textheight00)
  30.        )
  31.      )
  32.    (setq textheight (atof (getstring "\n >>>请输入标注文字高度<6>:")))
  33.   )
  34.   (if (or (= textheight nil)(= textheight "")(<= textheight 0)) (setq textheight 6.0))
  35.   ;(command "zoom" "w" note2_first_corner note2_other_corner)
  36.   ;(command "zoom" "1.0x")
  37.   (setq zhakai "NO")
  38.   (command "undo" "be")
  39.   (setq note2_ss_insert (ssget "c" note2_first_corner note2_other_corner '((0 . "INSERT"))))
  40.   (if note2_ss_insert
  41.     (progn
  42.      (setq iit 0 zhakai "YES")
  43.      (repeat (sslength note2_ss_insert)
  44.         (command "explode" (ssname note2_ss_insert iit))  ;;;炸开图元
  45.         (setq iit (+ iit 1))
  46.      )
  47.    )
  48.   )
  49.   (setq note2_ss11 nil note2_ss22 nil  note2_ss33 nil  note2_ss44 nil)
  50.   ;(setq note2_ss11 (ssget "c" note2_first_corner note2_other_corner '((0 . "CIRCLE,*LINE,INSERT"))))
  51.   (setq note2_ss11 (ssget "c" note2_first_corner note2_other_corner '((0 . "CIRCLE"))))
  52.   (setq jg_ls_wz1 nil jg_ls_wz2 nil jg_ls_wz3 nil jg_ls_wz4 nil jg_ls_wz5 nil jg_ls_wz6 nil
  53.         jg_ls_wz7 nil jg_ls_wz8 nil jg_ls_wz9 nil jg_ls_wz10 nil jg_ls_wzcgy nil jg_ls_wz11 nil
  54.         jg_ls_wz12 nil jg_ls_wz13 nil jg_ls_wz14 nil jg_ls_wz15 nil jg_ls_wzdyx nil jg_ls_wzdyx1 nil)
  55.   (setq jg_zb_wza1 nil jg_zb_wza2 nil jg_zb_wza3 nil jg_zb_wza4 nil jg_zb_wza5 nil jg_zb_wza6 nil jg_zb_wza7 nil
  56.         jg_zb_wza8 nil jg_zb_wza9 nil jg_zb_wza10 nil jg_zb_wza11 nil jg_zb_wza12 nil jg_zb_wza13 nil jg_zb_wza14 nil
  57.         jg_zb_wza15 nil jg_zb_wzcgy nil jg_zb_wzdyx nil jg_zb_wzdyx1 nil jg_zb_wz_all1 '())
  58.   (note2_get_biaoqian_ls note2_ss11)
  59.   (setq jg_zb_wz_all1 (append jg_zb_wza1 jg_zb_wza2 jg_zb_wza3 jg_zb_wza4 jg_zb_wza5 jg_zb_wza6 jg_zb_wza7
  60.                               jg_zb_wza8 jg_zb_wza9 jg_zb_wza10 jg_zb_wza11 jg_zb_wza12 jg_zb_wza13 jg_zb_wza14
  61.                               jg_zb_wza15 jg_zb_wzcgy jg_zb_wzdyx jg_zb_wzdyx1));;结合所有坐标/编号列表
  62.   (setq jg_ls_wz_all1 (append jg_ls_wz1 jg_ls_wz3 jg_ls_wz4 jg_ls_wz5 jg_ls_wz13 jg_ls_wz6 jg_ls_wz14 jg_ls_wz2
  63.                               jg_ls_wzdyx jg_ls_wzdyx1 jg_ls_wz15  jg_ls_wz12 jg_ls_wz7  jg_ls_wz8 jg_ls_wz9 jg_ls_wz10
  64.                               jg_ls_wzcgy jg_ls_wz11));;按注解编号子母顺序,结合所有加工文字列表
  65.   (if (= zhakai "YES")
  66.     (progn
  67.      (command "undo" "B");;后退至炸开图元之前
  68.      (note2_jg_bh_out jg_zb_wz_all1);;写所有图元编号
  69.     )
  70.   )
  71.   (note2_jg_wz_out jg_ls_wz_all1);;动态输出加工注解
  72.   (SETVAR "osmode" 39)
  73.   (defun *error* (in_msg)    ;将描述错误的字串存入变数in_msg,还原定义错误后执行程序
  74.        (princ "返回错误原因:")
  75.        (princ in_msg)
  76.    )      ;显示错误资讯
  77.   (princ)
  78. )


  79. (defun note2_get_biaoqian_ls (note2_ss11 / data1_list zjpd_list lsyk_dd lsct_dd ndz_dd dlx_dd zfyk_dd dglsct_dd thk_dd
  80.                                          wdz_dd  qdy_dd  jzk_dd  nxwz_dd  fsdlx_dd  czk_dd yczk_dd  dyx1_dd
  81.                                          ss_lswk1 ss_lswk2 aa00 name00 dd00 deep00 jx00 zs00 dh00
  82.                                          aa name dd deep jx dh zs ) ;;得到群码-3数据列表
  83. (setq data1_list '() lsct_dd '() lsyk_dd  '() gdx_dd '() ndz_dd '() dlx_dd '() zfyk_dd '() dglsct_dd '() thk_dd '()
  84.     wdz_dd '() qdy_dd '() jzk_dd '() nxwz_dd '() fsdlx_dd '()  czk_dd '() yczk_dd  '() dyx1_dd '())
  85. (if note2_ss11
  86. (while (/= (sslength note2_ss11) 0)
  87.    (if (zjsx_zz_getx (ssname note2_ss11 0))
  88.     (if (and (/= (nth 0 (zz_read_zfc qm3_jg_data)) "")(/= (zz_read_zfc qm3_jg_data) nil))
  89.      (progn
  90.       (setq aa   (nth 0 zf_list))
  91.       (setq name (nth 1 zf_list))
  92.       (setq dd   (nth 2 zf_list))
  93.       (setq deep (nth 3 zf_list))
  94.       (setq jx   (nth 4 zf_list))
  95.       (if (= (setq zs (nth 5 zf_list)) nil)
  96.          (setq zs "NIL")
  97.       )
  98.       (setq zf_list11 zf_list)
  99.       (if (= (nth 1 (zf_fenli1 name)) "BOX")
  100.          (if (= (setq zs (nth 8 zf_list11)) nil)
  101.            (setq zs "NIL")
  102.          )
  103.       )
  104.       (setq mk qm3_pm_data)
  105.       (if (or (= qm3_dh_data nil) (= qm3_dh_data ""))
  106.          (setq dh "NIL")
  107.          (setq dh qm3_dh_data)
  108.        )
  109.       (setq aa00 aa)
  110.       (setq name00 name)
  111.       (setq dd00 dd)
  112.       (setq deep00 deep)
  113.       (setq jx00 jx)
  114.       (setq zs00 zs)
  115.       (setq dh00 dh)
  116. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  117.       (if (= (cdr (assoc 0 (entget (ssname note2_ss11 0)))) "CIRCLE")
  118.         (progn
  119.           (setq x_dd (rtos (cdr (assoc 40 (entget (ssname note2_ss11 0)))) 2 3))
  120.           (setq x_pt (cdr (assoc 10 (entget (ssname note2_ss11 0)))))

  121. ;;;;;;;;;;;;;;;;;沉头过孔 A*类,********后续增加单独沉头f_sinkTSCR
  122.           (if (or (= name00 "gen1TSCR+")(= name00 "gen1BSCR+")(= name00 "gen1TSCR")(= name00 "gen1BSCR"))
  123.              (progn
  124.                (setq ss_lswk1 nil)
  125.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  126.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  127.                (if (/= (sslength ss_lswk1) 0)
  128.                 (progn
  129.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  130.                   (repeat (sslength ss_lswk1)
  131.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  132.                     (if (or (= name "f_sinkTSCR")(= name "f_sinkBSCR")(= name "f_sink_scrTSCR")(= name "f_sink_scrBSCR"))
  133.                       (progn
  134.                        (setq gg11 dd)
  135.                        (setq dep11 deep)
  136.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  137.                        (setq run_time "onlyone");;仅抓取一个
  138.                        )
  139.                        (if (/= run_time "onlyone")
  140.                          (progn
  141.                            (setq gg11 "0.000")
  142.                            (setq dep11 "0.000")
  143.                          )
  144.                        )
  145.                      )
  146.                     (setq ssnn (+ ssnn 1))
  147.                   )
  148.                 )
  149.                 (progn
  150.                   (setq gg11 "0.000")
  151.                   (setq dep11 "0.000")
  152.                 )
  153.                )
  154.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  155.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  156.                (setq lsct_dd (cons zjpd_list lsct_dd))
  157.              )
  158.           )
  159. ;;;;;;;;;;;;;;;;;;
  160. ;;;;;;;;;;;;;;;;;;牙孔 沉头攻牙 M*类
  161.           (if (or (= name00 "m_screwTSCR+")(= name00 "m_screwBSCR+")(= name00 "m_screwTSCR")
  162.                   (= name00 "m_screwBSCR")(= name00 "Fm_screwTSCR")(= name00 "Fm_screwBSCR")
  163.                   (= name00 "m_screwHO"))
  164.              (progn
  165.                (setq ss_lswk2 nil jx001 nil  jx002 nil)
  166.                (setq ss_lswk2 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "ARC") (cons 10 x_pt) )))
  167.                (if ss_lswk2
  168.                 (if (= (sslength ss_lswk2) 0);;判断攻牙正面背面
  169.                   (setq jx00 "*面")
  170.                   (progn
  171.                      (setq zf0 0)
  172.                      (repeat (sslength ss_lswk2);;
  173.                        (if (OR (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "HIDDEN")
  174.                            (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "HIDDEN2")
  175.                            (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "DASHED"))
  176.                          (progn
  177.                            (setq jx001 "背面")
  178.                            (setq jx00 "背面")
  179.                          )
  180.                          (progn
  181.                            (setq jx002 "正面")
  182.                            (setq jx00 "正面")
  183.                          )
  184.                        )
  185.                        (if (and (= jx001 "背面") (= jx002 "正面"))
  186.                           (setq jx00 "正面+背面")
  187.                         )
  188.                      (setq zf0 (+ zf0 1))
  189.                      );;repeat
  190.                   )
  191.                 )
  192.                 (setq jx00 "*面")
  193.                )
  194.                (setq ss_lswk1 nil)
  195.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  196.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  197.                (if (/= (sslength ss_lswk1) 0)
  198.                 (progn
  199.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  200.                   (repeat (sslength ss_lswk1)
  201.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  202.                     (if (or (= name "f_sink_scrTSCR")(= name "f_sink_scrBSCR"))
  203.                       (progn
  204.                        (setq gg11 dd)
  205.                        (setq dep11 deep)
  206.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  207.                        (setq run_time "onlyone");;仅抓取一个
  208.                        )
  209.                        (if (/= run_time "onlyone")
  210.                          (progn
  211.                            (setq gg11 "0.000")
  212.                            (setq dep11 "0.000")
  213.                          )
  214.                        )
  215.                      )
  216.                     (setq ssnn (+ ssnn 1))
  217.                   )
  218.                 )
  219.                 (progn
  220.                   (setq gg11 "0.000")
  221.                   (setq dep11 "0.000")
  222.                 )
  223.                )
  224.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  225.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  226.                (setq lsyk_dd (cons zjpd_list lsyk_dd))
  227.              )
  228.           )
  229. ;;;;;;;;;;;;;;;;;;
  230. ;;;;;;;;;;;;;;;;;固定销孔 B*类,********后续增加单独沉头g_sinkTPIN
  231.           (if (or (= name00 "gen1RTPIN+")(= name00 "gen1RBPIN+")
  232.                   (= name00 "gen1RTPIN")(= name00 "gen1RBPIN")
  233.                   (= name00 "posTPIN")(= name00 "posBPIN")
  234.                   (= name00 "posTPIN+")(= name00 "posBPIN+")
  235.                   (= name00 "gen1TPIN")(= name00 "gen1BPIN"))
  236.              (progn
  237.                (setq ss_lswk1 nil)
  238.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  239.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  240.                (if (/= (sslength ss_lswk1) 0)
  241.                 (progn
  242.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  243.                   (repeat (sslength ss_lswk1)
  244.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  245.                     (if (or (= name "g_sinkTPIN")(= name "g_sinkBPIN"))
  246.                       (progn
  247.                        (setq gg11 dd)
  248.                        (setq dep11 deep)
  249.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  250.                        (setq run_time "onlyone");;仅抓取一个
  251.                        )
  252.                        (if (/= run_time "onlyone")
  253.                          (progn
  254.                            (setq gg11 "0.000")
  255.                            (setq dep11 "0.000")
  256.                          )
  257.                        )
  258.                      )
  259.                     (setq ssnn (+ ssnn 1))
  260.                   )
  261.                 )
  262.                 (progn
  263.                   (setq gg11 "0.000")
  264.                   (setq dep11 "0.000")
  265.                 )
  266.                )
  267.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  268.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  269.                (setq gdx_dd (cons zjpd_list gdx_dd))
  270.              )
  271.           )
  272. ;;;;;;;;;;;;;;;;;;
  273. ;;;;;;;;;;;;;;;;;内导柱孔 C*类,********后续增加单独沉头g_sinkIGPB
  274.           (if (or (= name00 "posIGPB+")(= name00 "posIGPB")(= name00 "genIGPB"))
  275.              (progn
  276.                (setq ss_lswk1 nil)
  277.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  278.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  279.                (if (/= (sslength ss_lswk1) 0)
  280.                 (progn
  281.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  282.                   (repeat (sslength ss_lswk1)
  283.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  284.                     (if (= name "g_sinkIGPB")
  285.                       (progn
  286.                        (setq gg11 dd)
  287.                        (setq dep11 deep)
  288.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  289.                        (setq run_time "onlyone");;仅抓取一个
  290.                        )
  291.                        (if (/= run_time "onlyone")
  292.                          (progn
  293.                            (setq gg11 "0.000")
  294.                            (setq dep11 "0.000")
  295.                          )
  296.                        )
  297.                      )
  298.                     (setq ssnn (+ ssnn 1))
  299.                   )
  300.                 )
  301.                 (progn
  302.                   (setq gg11 "0.000")
  303.                   (setq dep11 "0.000")
  304.                 )
  305.                )
  306.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  307.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  308.                (setq ndz_dd (cons zjpd_list ndz_dd))
  309.              )
  310.           )
  311. ;;;;;;;;;;;;;;;;;;
  312. ;;;;;;;;;;;;;;;;;顶料销孔 D*类,********后续增加单独沉头g_sinkTLPS/g_sinkBLPS
  313.           (if (or (= name00 "gen0TLPS+")(= name00 "gen0BLPS+")
  314.                   (= name00 "gen0TLPS")(= name00 "gen0BLPS")
  315.                   (= name00 "genTLPS")(= name00 "genBLPS"))
  316.              (progn
  317.                (setq ss_lswk1 nil)
  318.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  319.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  320.                (if (/= (sslength ss_lswk1) 0)
  321.                 (progn
  322.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  323.                   (repeat (sslength ss_lswk1)
  324.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  325.                     (if (or (= name "g_sinkTLPS")(= name "g_sinkBLPS")(= name "set_screwTLPS")(= name "set_screwBLPS"))
  326.                       (progn
  327.                        (if (or (= name "set_screwTLPS")(= name "set_screwBLPS"))
  328.                            (setq jx00 "止付")
  329.                        )
  330.                        (setq gg11 dd)
  331.                        (setq dep11 deep)
  332.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  333.                        (setq run_time "onlyone");;仅抓取一个
  334.                        )
  335.                        (if (/= run_time "onlyone")
  336.                          (progn
  337.                            (setq gg11 "0.000")
  338.                            (setq dep11 "0.000")
  339.                          )
  340.                        )
  341.                      )
  342.                     (setq ssnn (+ ssnn 1))
  343.                   )
  344.                 )
  345.                 (progn
  346.                   (setq gg11 "0.000")
  347.                   (setq dep11 "0.000")
  348.                 )
  349.                )
  350.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  351.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  352.                (setq dlx_dd (cons zjpd_list dlx_dd))
  353.              )
  354.           )
  355. ;;;;;;;;;;;;;;;;;;
  356. ;;;;;;;;;;;;;;;;;;如果中间有顶针孔则忽略,否则按止付牙 D*类
  357.           (if (or (= name00 "set_screwTLPS")(= name00 "set_screwBLPS") (= name00 "set_screwBGLS") )
  358.              (progn
  359.                (setq ss_lswk1 nil)
  360.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  361.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  362.                (setq name nil ssnn 0 run_time "no_onlyone")
  363.                (if (/= (sslength ss_lswk1) 0)
  364.                   (repeat (sslength ss_lswk1)
  365.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  366.                     (if (or (= name "gen0TLPS+")(= name "gen0BLPS+")
  367.                             (= name "gen0TLPS")(= name "gen0BLPS")
  368.                             (= name "genTLPS")(= name "genBLPS"))
  369.                        (setq run_time "onlyone");;判断是否有顶料销内孔图元
  370.                      )
  371.                      (setq ssnn (+ ssnn 1))
  372.                     );;repeat
  373.                  )
  374.                (if (/= run_time "onlyone")
  375.                  (progn
  376.                    (setq ss_lswk2 nil jx001 nil  jx002 nil)
  377.                    (setq ss_lswk2 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "ARC") (cons 10 x_pt) )))
  378.                    (if ss_lswk2
  379.                     (if (= (sslength ss_lswk2) 0);;判断攻牙正面背面
  380.                       (setq jx00 "*面")
  381.                       (progn
  382.                          (setq zf0 0)
  383.                          (repeat (sslength ss_lswk2);;
  384.                            (if (OR (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "HIDDEN")
  385.                                (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "HIDDEN2")
  386.                                (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "DASHED"))
  387.                              (progn
  388.                                (setq jx001 "背面")
  389.                                (setq jx00 "背面")
  390.                              )
  391.                              (progn
  392.                                (setq jx002 "正面")
  393.                                (setq jx00 "正面")
  394.                              )
  395.                            )
  396.                            (if (and (= jx001 "背面") (= jx002 "正面"))
  397.                               (setq jx00 "正面+背面")
  398.                             )
  399.                          (setq zf0 (+ zf0 1))
  400.                          );;repeat
  401.                       )
  402.                     )
  403.                     (setq jx00 "*面")
  404.                    )
  405.                    (setq gg11 "0.000")
  406.                    (setq dep11 "0.000")
  407.                    (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  408.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  409.                    (setq zfyk_dd (cons zjpd_list zfyk_dd))
  410.                  )
  411.                )
  412.              )
  413.           )

  414. ;;;;;;;;;;;;;;;;;;
  415. ;;;;;;;;;;;;;;;;;等高套沉头过孔,牙孔 Q*类,********后续增加单独沉头g_sinkCSR
  416.           (if (or (= name00 "gen0CSR+")(= name00 "gen0CSR")(= name00 "m_screw0CSR"))
  417.              (progn
  418.                (setq ss_lswk1 nil)
  419.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  420.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  421.                (if (/= (sslength ss_lswk1) 0)
  422.                 (progn
  423.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  424.                   (repeat (sslength ss_lswk1)
  425.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  426.                     (if (= name "g_sinkCSR")
  427.                       (progn
  428.                        (setq gg11 dd)
  429.                        (setq dep11 deep)
  430.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  431.                        (setq run_time "onlyone");;仅抓取一个
  432.                        )
  433.                        (if (/= run_time "onlyone")
  434.                          (progn
  435.                            (setq gg11 "0.000")
  436.                            (setq dep11 "0.000")
  437.                          )
  438.                        )
  439.                      )
  440.                     (setq ssnn (+ ssnn 1))
  441.                   )
  442.                 )
  443.                 (progn
  444.                   (setq gg11 "0.000")
  445.                   (setq dep11 "0.000")
  446.                 )
  447.                )
  448.                (if (= name00 "m_screw0CSR")
  449.                  (progn
  450.                    (setq ss_lswk2 nil jx001 nil  jx002 nil)
  451.                    (setq ss_lswk2 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "ARC") (cons 10 x_pt) )))
  452.                    (if ss_lswk2
  453.                     (if (= (sslength ss_lswk2) 0);;判断攻牙正面背面
  454.                       (setq jx00 "*面攻")
  455.                       (progn
  456.                          (setq zf0 0)
  457.                          (repeat (sslength ss_lswk2);;
  458.                            (if (OR (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "HIDDEN")
  459.                                (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "HIDDEN2")
  460.                                (= (cdr (assoc '6 (entget (ssname ss_lswk2 zf0)))) "DASHED"))
  461.                              (progn
  462.                                (setq jx001 "背面攻")
  463.                                (setq jx00 "背面攻")
  464.                              )
  465.                              (progn
  466.                                (setq jx002 "正面攻")
  467.                                (setq jx00 "正面攻")
  468.                              )
  469.                            )
  470.                            (if (and (= jx001 "背面攻") (= jx002 "正面攻"))
  471.                               (setq jx00 "正面+背面攻")
  472.                             )
  473.                          (setq zf0 (+ zf0 1))
  474.                          );;repeat
  475.                       )
  476.                     )
  477.                     (setq jx00 "*面攻")
  478.                    )
  479.                  )
  480.                )
  481.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  482.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  483.                (setq dglsct_dd (cons zjpd_list dglsct_dd))
  484.              )
  485.           )
  486. ;;;;;;;;;;;;;;;;;;
  487. ;;;;;;;;;;;;;;;;;弹簧孔 T*类
  488.           (if (or (= name00 "f_sinkTSPR")(= name00 "f_sinkBSPR")(= name00 "gen1TSPR")(= name00 "gen1BSPR"))
  489.              (progn
  490.                (if (OR (= (cdr (assoc '6 (entget (ssname note2_ss11 0)))) "HIDDEN")
  491.                    (= (cdr (assoc '6 (entget (ssname note2_ss11 0)))) "HIDDEN2")
  492.                    (= (cdr (assoc '6 (entget (ssname note2_ss11 0)))) "DASHED"))
  493.                   (if (> (atof deep00) 0)
  494.                     (ALERT "存在深度数据与线型不一致的图元,确认后以深度数据为准,请检查!!!")
  495.                   )
  496.                   (if (< (atof deep00) 0)
  497.                     (ALERT "存在深度数据与线型不一致的图元,确认后以深度数据为准,请检查!!!")
  498.                   )
  499.                )
  500.                (setq gg11 "0.000")
  501.                (setq dep11 "0.000")
  502.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  503.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  504.                (setq thk_dd (cons zjpd_list thk_dd))
  505.              )
  506.           )
  507. ;;;;;;;;;;;;;;;;;;
  508. ;;;;;;;;;;;;;;;;;外导柱孔 O*类
  509.           (if (or (= name00 "gen0QOGPB+")(= name00 "genQOGPB")(= name00 "posOGPB+")(= name00 "posOGPB"))
  510.              (progn
  511.                (setq ss_lswk1 nil)
  512.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  513.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  514.                (if (/= (sslength ss_lswk1) 0)
  515.                 (progn
  516.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  517.                   (repeat (sslength ss_lswk1)
  518.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  519.                     (if (= name "g_sinkOGPB")
  520.                       (progn
  521.                        (setq gg11 dd)
  522.                        (setq dep11 deep)
  523.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  524.                        (setq run_time "onlyone");;仅抓取一个
  525.                        )
  526.                        (if (/= run_time "onlyone")
  527.                          (progn
  528.                            (setq gg11 "0.000")
  529.                            (setq dep11 "0.000")
  530.                          )
  531.                        )
  532.                      )
  533.                     (setq ssnn (+ ssnn 1))
  534.                   )
  535.                 )
  536.                 (progn
  537.                   (setq gg11 "0.000")
  538.                   (setq dep11 "0.000")
  539.                 )
  540.                )
  541.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  542.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  543.                (setq wdz_dd (cons zjpd_list wdz_dd))
  544.              )
  545.           )
  546. ;;;;;;;;;;;;;;;;;;
  547. ;;;;;;;;;;;;;;;;;起吊牙孔 L*类
  548.           (if (= name00 "m_screwUSER")
  549.              (progn
  550.                (setq ss_lswk1 nil)
  551.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  552.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  553.                (setq gg11 "0.000")
  554.                (setq dep11 "0.000")
  555.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  556.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  557.                (setq qdy_dd (cons zjpd_list qdy_dd))
  558.              )
  559.           )
  560. ;;;;;;;;;;;;;;;;;;
  561. ;;;;;;;;;;;;;;;;;基准孔 U*类
  562.           (if (= name00 "gen1RORG+")
  563.              (progn
  564.                (setq ss_lswk1 nil)
  565.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  566.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  567.                (if (/= (sslength ss_lswk1) 0)
  568.                 (progn
  569.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  570.                   (repeat (sslength ss_lswk1)
  571.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  572.                     (if (= name "posORG")
  573.                       (progn
  574.                        (setq gg11 dd)
  575.                        (setq dep11 deep)
  576.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  577.                        (setq run_time "onlyone");;仅抓取一个
  578.                        )
  579.                        (if (/= run_time "onlyone")
  580.                          (progn
  581.                            (setq gg11 "0.000")
  582.                            (setq dep11 "0.000")
  583.                          )
  584.                        )
  585.                      )
  586.                     (setq ssnn (+ ssnn 1))
  587.                   )
  588.                 )
  589.                 (progn
  590.                   (setq gg11 "0.000")
  591.                   (setq dep11 "0.000")
  592.                 )
  593.                )
  594.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  595.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  596.                (setq jzk_dd (cons zjpd_list jzk_dd))
  597.              )
  598.           )
  599. ;;;;;;;;;;;;;;;;;;
  600. ;;;;;;;;;;;;;;;;;内限位孔 N*类
  601.           (if (or (= name00 "gen1LTH") (= name00 "f_sinkLTH"))
  602.              (progn
  603.                (setq ss_lswk1 nil)
  604.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  605.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  606.                (setq gg11 "0.000")
  607.                (setq dep11 "0.000")
  608.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  609.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  610.                (setq nxwz_dd (cons zjpd_list nxwz_dd))
  611.              )
  612.           )
  613. ;;;;;;;;;;;;;;;;;;
  614. ;;;;;;;;;;;;;;;;;两用销孔 D*类
  615.           (if (or (= name00 "posBGLS+")(= name00 "posBGLS")
  616.                   (= name00 "genBGLS")(= name00 "f_sinkBGLS"))
  617.              (progn
  618.                (setq ss_lswk1 nil)
  619.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  620.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  621.                (if (and (/= (sslength ss_lswk1) 0)(or (= name00 "posBGLS+") (= name00 "posBGLS")) )
  622.                 (progn
  623.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  624.                   (repeat (sslength ss_lswk1)
  625.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  626.                     (if (= name "f_sinkBGLS")
  627.                       (progn
  628.                        (setq gg11 dd)
  629.                        (setq dep11 deep)
  630.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  631.                        (setq run_time "onlyone");;仅抓取一个
  632.                        )
  633.                        (if (/= run_time "onlyone")
  634.                          (progn
  635.                            (setq gg11 "0.000")
  636.                            (setq dep11 "0.000")
  637.                          )
  638.                        )
  639.                      )
  640.                     (setq ssnn (+ ssnn 1))
  641.                   )
  642.                 )
  643.                 (progn
  644.                   (setq gg11 "0.000")
  645.                   (setq dep11 "0.000")
  646.                 )
  647.                )
  648.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  649.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  650.                (setq fsdlx_dd (cons zjpd_list fsdlx_dd))
  651.              )
  652.           )
  653. ;;;;;;;;;;;;;;;;;;
  654. ;;;;;;;;;;;;;;;;;插针孔 F*类 +内定位孔 F*类
  655.           (if (or (= name00 "posBPP+")(= name00 "posBPP")
  656.                   (= name00 "gen1BPP")
  657.                   (= name00 "posPPIN+")(= name00 "posPPIN")
  658.                   (= name00 "genPPIN"))
  659.              (progn
  660.                (setq ss_lswk1 nil)
  661.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  662.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  663.                (if (and (/= (sslength ss_lswk1) 0)(or (= name00 "posBPP+") (= name00 "posBPP") (= name00 "posPPIN+")(= name00 "posPPIN")) )
  664.                 (progn
  665.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  666.                   (repeat (sslength ss_lswk1)
  667.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  668.                     (if (OR (= name "g_sinkBPP")(= name "g_sinkPPIN"))
  669.                       (progn
  670.                        (setq gg11 dd)
  671.                        (setq dep11 deep)
  672.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  673.                        (setq run_time "onlyone");;仅抓取一个
  674.                        )
  675.                        (if (/= run_time "onlyone")
  676.                          (progn
  677.                            (setq gg11 "0.000")
  678.                            (setq dep11 "0.000")
  679.                          )
  680.                        )
  681.                      )
  682.                     (setq ssnn (+ ssnn 1))
  683.                   )
  684.                 )
  685.                 (progn
  686.                   (setq gg11 "0.000")
  687.                   (setq dep11 "0.000")
  688.                 )
  689.                )
  690.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  691.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  692.                (setq czk_dd (cons zjpd_list czk_dd))
  693.              )
  694.           )
  695. ;;;;;;;;;;;;;;;;;;
  696. ;;;;;;;;;;;;;;;;;圆冲针孔 P*类
  697.           (if (or (= name00 "pos1AP0+")(= name00 "pos1AP0")(= name00 "pos1AP")
  698.                   (= name00 "gen1AP0")(= name00 "gen1AP")(= name00 "gen1"))
  699.              (progn
  700.                (setq ss_lswk1 nil)
  701.                (setq ss_lswk1 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "CIRCLE") (cons 10 x_pt) )))
  702.                (note2_del_yss1 (ssadd (ssname note2_ss11 0)) ss_lswk1);;把当前图元和一样半径的选择集从ss_lswk1中删掉
  703.                (if (and (/= (sslength ss_lswk1) 0)(or (= name00 "pos1AP0+") (= name00 "pos1AP0")(= name00 "pos1AP")) )
  704.                 (progn
  705.                   (setq dd nil deep nil ssnn 0 run_time "no_onlyone")
  706.                   (repeat (sslength ss_lswk1)
  707.                     (zjsx_get_biaoqian (ssadd (ssname ss_lswk1 ssnn)))
  708.                     (if (or (= name "g_sink1AP0")(= name "s_sink1AP0"))
  709.                       (progn
  710.                        (setq gg11 dd)
  711.                        (setq dep11 deep)
  712.                        (note2_del_yss1 ss_lswk1 note2_ss11);;如果存在外圆,从把当前图元和一样半径的选择集从note2_ss11中删除
  713.                        (setq run_time "onlyone");;仅抓取一个
  714.                        )
  715.                        (if (/= run_time "onlyone")
  716.                          (progn
  717.                            (setq gg11 "0.000")
  718.                            (setq dep11 "0.000")
  719.                          )
  720.                        )
  721.                      )
  722.                     (setq ssnn (+ ssnn 1))
  723.                   )
  724.                 )
  725.                 (progn
  726.                   (setq gg11 "0.000")
  727.                   (setq dep11 "0.000")
  728.                 )
  729.                )
  730.                (setq zjpd_list (list x_dd (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/" gg11 "/" dep11)
  731.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  732.                (setq yczk_dd (cons zjpd_list yczk_dd))
  733.              )
  734.           )
  735. ;;;;;;;;;;;;;;;;;;
  736. ;;;;;;;;;;;;;;;;;线割孔,铣孔 K*类 圆孔类
  737.           (if (or(= name00 "CP1")(= name00 "CP2")(= name00 "CP3")(= name00 "CP4")
  738.                  (= name00 "CP5")(= name00 "精铣") (= name00 "铣床"))
  739.           (progn
  740.              (setq zjpd_list (list dd00 (strcat aa00 "/" name00 "/" dd00 "/" x_dd "/" deep00 "/" jx00 "/" zs00 "/" dh00  "/0.000/0.000")
  741.                         x_pt (ssname note2_ss11 0) ));;转为标准格式列表
  742.              (setq dyx1_dd (cons zjpd_list dyx1_dd))
  743.             )
  744.           )
  745. ;;;;;;;;;;;;;;;;;;
  746.         )
  747.       )
  748. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  749.       )
  750.      )
  751.     );;if/=""
  752.        (note2_del_yss1 (ssadd (ssname note2_ss11 0)) note2_ss11);;当前图元从note2_ss11中删除
  753. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  754.   );;while
  755. );if
  756. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  757. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  758.   (setq jg_ls_wz1 '() jg_ls_wz2 '()  jg_ls_wz3 '()  jg_ls_wz4 '() jg_ls_wz5 '()  jg_ls_wz6 '()
  759.         jg_ls_wz7 '() jg_ls_wz8 '()  jg_ls_wz9 '() jg_ls_wz10 '() jg_ls_wz11 '() jg_ls_wz12 '()
  760.         jg_ls_wz13 '() jg_ls_wz14 '() jg_ls_wz15 '()   )
  761.   (if lsct_dd
  762.     (progn
  763.       (setq data1_list (note2_qm3_to_stlist_px lsct_dd));;对螺丝沉头标准格式列表按半径大小排序
  764.       (note2_qm3_stlist_jg1 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz1
  765.      )
  766.    )
  767.   (if lsyk_dd
  768.     (progn
  769.       (setq data1_list (note2_qm3_to_stlist_px lsyk_dd));;对螺丝牙孔标准格式列表按半径大小排序
  770.       (note2_qm3_stlist_jg2 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz2
  771.      )
  772.    )
  773.   (if gdx_dd
  774.     (progn
  775.       (setq data1_list (note2_qm3_to_stlist_px gdx_dd));;对固定销孔标准格式列表按半径大小排序
  776.       (note2_qm3_stlist_jg3 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz3
  777.      )
  778.    )
  779.   (if ndz_dd
  780.     (progn
  781.       (setq data1_list (note2_qm3_to_stlist_px ndz_dd));;对内导柱孔标准格式列表按半径大小排序
  782.       (note2_qm3_stlist_jg4 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz4
  783.      )
  784.    )
  785.   (if dlx_dd
  786.     (progn
  787.       (setq data1_list (note2_qm3_to_stlist_px dlx_dd));;对顶料销孔标准格式列表按半径大小排序
  788.       (note2_qm3_stlist_jg5 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz5
  789.      )
  790.    )
  791.   (if zfyk_dd
  792.     (progn
  793.       (setq data1_list (note2_qm3_to_stlist_px zfyk_dd));;对止付牙孔标准格式列表按半径大小排序
  794.       (note2_qm3_stlist_jg6 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz6
  795.      )
  796.    )
  797.   (if dglsct_dd
  798.     (progn
  799.       (setq data1_list (note2_qm3_to_stlist_px dglsct_dd));;对等高套孔标准格式列表按半径大小排序
  800.       (note2_qm3_stlist_jg7 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz7
  801.      )
  802.    )
  803.   (if thk_dd
  804.     (progn
  805.       (setq data1_list (note2_qm3_to_stlist_px thk_dd));;对弹簧孔标准格式列表按半径大小排序
  806.       (note2_qm3_stlist_jg8 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz8
  807.      )
  808.    )
  809.   (if wdz_dd
  810.     (progn
  811.       (setq data1_list (note2_qm3_to_stlist_px wdz_dd));;对外导柱孔标准格式列表按半径大小排序
  812.       (note2_qm3_stlist_jg9 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz9
  813.      )
  814.    )
  815.   (if qdy_dd
  816.     (progn
  817.       (setq data1_list (note2_qm3_to_stlist_px qdy_dd));;对起吊孔标准格式列表按半径大小排序
  818.       (note2_qm3_stlist_jg10 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz10
  819.      )
  820.    )
  821.   (if jzk_dd
  822.     (progn
  823.       (setq data1_list (note2_qm3_to_stlist_px jzk_dd));;对基准孔孔标准格式列表按半径大小排序
  824.       (note2_qm3_stlist_jg11 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz11
  825.      )
  826.    )
  827.   (if nxwz_dd
  828.     (progn
  829.       (setq data1_list (note2_qm3_to_stlist_px nxwz_dd));;对内限位孔孔标准格式列表按半径大小排序
  830.       (note2_qm3_stlist_jg12 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz12
  831.      )
  832.    )
  833.   (if fsdlx_dd
  834.     (progn
  835.       (setq data1_list (note2_qm3_to_stlist_px fsdlx_dd));;对两用销孔标准格式列表按半径大小排序
  836.       (note2_qm3_stlist_jg13 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz13
  837.      )
  838.    )
  839.   (if czk_dd
  840.     (progn
  841.       (setq data1_list (note2_qm3_to_stlist_px czk_dd));;对插针孔标准格式列表按半径大小排序
  842.       (note2_qm3_stlist_jg14 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz14
  843.      )
  844.    )
  845.   (if yczk_dd
  846.     (progn
  847.       (setq data1_list (note2_qm3_to_stlist_px yczk_dd));;对圆冲针孔标准格式列表按半径大小排序
  848.       (note2_qm3_stlist_jg15 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wz15
  849.      )
  850.    )
  851.   (if dyx1_dd
  852.     (progn
  853.        (setq data1_list (note2_qm3_to_stlist_px dyx1_dd));;对多义线之外的圆孔标准格式列表按半径大小排序
  854.        (note2_qm3_stlist_jgdyx1 data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wzdyx1
  855.      )
  856.    )


  857. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;以下增加侧攻牙
  858.   (setq note2_ss22 (ssadd) cmgy_dd nil x_pt1_list '())
  859.   (setq note2_ss22 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "LINE") (cons 6 "CENTER")  )))
  860.   (if note2_ss22
  861.     (while (/= (sslength note2_ss22) 0)
  862.      (if (zjsx_zz_getx (ssname note2_ss22 0))
  863.       (if (and (/= (nth 0 (zz_read_zfc qm3_jg_data)) "")(/= (zz_read_zfc qm3_jg_data) nil))
  864.        (progn
  865.         (setq x_pt (cdr (assoc 10 (entget (ssname note2_ss22 0)))))
  866.         (setq x_pt1 (cdr (assoc 11 (entget (ssname note2_ss22 0)))))
  867.         (setq aa00   (nth 0 zf_list))
  868.         (setq name00 (nth 1 zf_list))
  869.         (setq dd00   (nth 2 zf_list))
  870.         (setq deep00 (nth 3 zf_list))
  871.         (setq jx00 (nth 4 zf_list))
  872.         (setq zs00 (nth 5 zf_list))
  873.         (if (or (= qm3_dh_data nil) (= qm3_dh_data ""))
  874.          (setq dh00 "NIL")
  875.          (setq dh00 qm3_dh_data)
  876.         )
  877.         (if (= name00 "m_screwHO")
  878.           (progn
  879.              (setq zjpd_list (list dd00 (strcat aa00 "/" name00 "/" dd00 "/0.000/" deep00 "/" jx00 "/" zs00 "/" dh00  "/0.000/0.000")
  880.                         (list x_pt x_pt1) (ssname note2_ss22 0) ));;转为标准格式列表
  881.              (setq cmgy_dd (cons zjpd_list cmgy_dd))
  882.             )
  883.          )
  884.        )
  885.       )
  886.      )
  887.      (del_ss1 (ssadd (ssname note2_ss22 0)) note2_ss22);;当前图元从note2_ss22中删除
  888.     );;while
  889.    );;if/=nil
  890. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  891.   (if cmgy_dd
  892.     (progn
  893.        (setq data1_list (note2_qm3_to_stlist_px cmgy_dd));;对侧攻牙孔标准格式列表按半径大小排序
  894.        (note2_qm3_stlist_jgcgy data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wzcgy
  895.      )
  896.    )
  897. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  898. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;以下增加线割孔,铣孔,多义线扩展数据
  899.   (setq note2_ss33 (ssadd) dyx_dd nil x_pt1_list '())
  900.   (setq note2_ss33 (ssget "c" note2_first_corner note2_other_corner (list (cons 0 "LWPOLYLINE") )))
  901.   (if note2_ss33
  902.     (while (/= (sslength note2_ss33) 0)
  903.      (if (zjsx_zz_getx (ssname note2_ss33 0))
  904.       (if (and (/= (nth 0 (zz_read_zfc qm3_jg_data)) "")(/= (zz_read_zfc qm3_jg_data) nil))
  905.        (progn
  906.         (get_xy (ssadd (ssname note2_ss33 0)))
  907.         (setq x_pt (pt_mid (list minx miny) (list maxx maxy)))
  908.         (setq aa00   (nth 0 zf_list))
  909.         (setq name00 (nth 1 zf_list))
  910.         (setq dd00   (nth 2 zf_list))
  911.         (setq deep00 (nth 3 zf_list))
  912.         (setq jx00 (nth 4 zf_list))
  913.         (setq zs00 (nth 5 zf_list))
  914.         (if (or (= qm3_dh_data nil) (= qm3_dh_data ""))
  915.          (setq dh00 "NIL")
  916.          (setq dh00 qm3_dh_data)
  917.         )
  918.         (if (or(= name00 "CP1")(= name00 "CP2")(= name00 "CP3")(= name00 "CP4")(= name00 "CP5")
  919.             (= name00 "精铣") (= name00 "铣床")(= name00 "BUSH"))
  920.           (progn
  921.              (setq zjpd_list (list dd00 (strcat aa00 "/" name00 "/" dd00 "/0.000/" deep00 "/" jx00 "/" zs00 "/" dh00  "/0.000/0.000")
  922.                         x_pt (ssname note2_ss33 0) ));;转为标准格式列表
  923.              (setq dyx_dd (cons zjpd_list dyx_dd))
  924.             )
  925.          )
  926.        )
  927.       )
  928.      )
  929.      (del_ss1 (ssadd (ssname note2_ss33 0)) note2_ss33);;当前图元从note2_ss33中删除
  930.     );;while
  931.    );;if/=nil
  932. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  933.   (if dyx_dd
  934.     (progn
  935.        (setq data1_list (note2_qm3_to_stlist_px dyx_dd));;对多义线孔标准格式列表按半径大小排序
  936.        (note2_qm3_stlist_jgdyx data1_list);;用排好序的列表数据,先写全部的编号,再生成加工文字列表jg_ls_wzdyx
  937.      )
  938.    )
  939. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  940. )
  941. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


本帖子中包含更多资源

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

x
 楼主| 发表于 2021-4-7 11:39 | 显示全部楼层
xiongqunan 发表于 2021-4-6 18:56
在这终于看到有人用PRESSCAD这个软件的了。

模具厂现在大多用UG画了,偶尔还是用2D画的,主要是没有64位系统CAD2007能用的破解版PRESSCAD输出注解,所以就自己编写了整理LISP按厂里的习惯输出.模具厂都辛苦,码农也辛苦
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 2021-4-7 11:28 | 显示全部楼层
paulpipi 发表于 2021-4-6 18:50
zjsx_zz_getx缺少这个函数,麻烦补齐,谢谢

下载note2.fas这个可以用,源代码粘贴不是很全,有子程序,有问题也可以加微信号 QQ269707064  讨论
发表于 2021-4-2 23:59 来自手机 | 显示全部楼层
怎么联系你
 楼主| 发表于 2021-4-5 11:03 | 显示全部楼层

有什么讨论,在帖子回复就行,我没权限发消息:D
发表于 2021-4-6 18:48 来自手机 | 显示全部楼层
zjsx_zz_getx没有定义这个函数,用不了
发表于 2021-4-6 18:50 来自手机 | 显示全部楼层
qiannianhuazi 发表于 2021-4-5 11:03
有什么讨论,在帖子回复就行,我没权限发消息

zjsx_zz_getx缺少这个函数,麻烦补齐,谢谢
发表于 2021-4-6 18:56 | 显示全部楼层
在这终于看到有人用PRESSCAD这个软件的了。
发表于 2021-4-6 19:03 来自手机 | 显示全部楼层
xiongqunan 发表于 2021-4-6 18:56
在这终于看到有人用PRESSCAD这个软件的了。

你是同行吗,
发表于 2021-4-6 20:50 | 显示全部楼层
对,做模具设计的。一个苦逼的干业。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-3 22:05 , Processed in 4.097974 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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