明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: xyp1964

【e派】ccgj(尺寸工具大全)-逐步放出所有代码

    [复制链接]
发表于 2012-4-18 00:12:53 来自手机 | 显示全部楼层
院长是好人,永远支持院长!
发表于 2012-4-19 18:02:29 | 显示全部楼层
很好用的东西,我想试用,
发表于 2012-5-17 22:47:03 | 显示全部楼层
好东西,顶起来!!!
 楼主| 发表于 2012-5-18 08:16:09 | 显示全部楼层

  1. (defun c:BZSZ (/ #bl lst Ilst)
  2.   (defun SetBL (ctbl)
  3.     (setq xyp-bl ctbl
  4.    xyp-sc (/ xyp-bl 100.0)
  5.     )
  6.     (vlax-ldata-put "dict-xyp1964" "xyp-bl" xyp-bl)
  7.     (vlax-ldata-put "dict-xyp1964" "xyp-sc" xyp-sc)
  8.   )
  9.   (defun main-bzsz ()
  10.     (SetBL ctbl)
  11.     (setq FGDW nil)
  12.     (SETVAR "USERR1" (/ 1 xyp-bl 1.0))
  13.     (SETVAR "DIMALT" 0)
  14.     (SETVAR "DIMALTD" 2)
  15.     (SETVAR "DIMALTF" 25.4)
  16.     (SETVAR "DIMASSOC" 1)
  17.     (SETVAR "DIMASZ" 1)
  18.     (setvar "DIMATFIT" 0)
  19.     (COMMAND "DIM" "DIMBLK" "DI" "Exit")
  20.     (COMMAND "DIM" "DIMBLK1" "DI" "Exit")
  21.     (COMMAND "DIM" "DIMBLK2" "DI" "Exit")
  22.     (SETVAR "DIMCEN" (* xyp-sc 150))
  23.     (COMMAND "DIM" "DIMCLRD" "BYBLOCK" "Exit")
  24.     (COMMAND "DIM" "DIMCLRE" "BYBLOCK" "Exit")
  25.     (COMMAND "DIM" "DIMCLRT" "BYBLOCK" "Exit")
  26.     (SETVAR "DIMDLE" 0)
  27.     (SETVAR "DIMDLI" 0)
  28.     (SETVAR "DIMEXE" 200)
  29.     (SETVAR "DIMGAP" 100)
  30.     (SETVAR "DIMLIM" 0)
  31.     (SETVAR "DIMRND" 0)
  32.     (SETVAR "DIMSAH" 0)
  33.     (SETVAR "DIMSCALE" xyp-sc)
  34.     (SETVAR "DIMSE1" 0)
  35.     (SETVAR "DIMSE2" 0)
  36.     (SETVAR "DIMSHO" 0)
  37.     (SETVAR "DIMSOXD" 0)
  38.     (SETVAR "DIMTAD" 1)
  39.     (SETVAR "DIMTFAC" 1)
  40.     (SETVAR "DIMTIH" 0)
  41.     (SETVAR "DIMTIX" 1)
  42.     (SETVAR "DIMTM" 0)
  43.     (SETVAR "DIMTOFL" 1)
  44.     (SETVAR "DIMTOH" 0)
  45.     (SETVAR "DIMTOL" 0)
  46.     (SETVAR "DIMTP" 0)
  47.     (SETVAR "DIMTSZ" 0)
  48.     (SETVAR "DIMTVP" 0)
  49.     (SETVAR "DIMZIN" 0)
  50.     (if (< xyp-bl 1.0)
  51.       (command "modemacro"
  52.         (strcat "XCAD BY e派." " 当前出图比例 1:" (rtos xyp-bl 2 1))
  53.       )
  54.       (command "modemacro"
  55.         (strcat "XCAD BY e派." " 当前出图比例 1:" (rtos xyp-bl 2))
  56.       )
  57.     )
  58.     (ch-dim-text)
  59.     (princ)
  60.   )
  61.   (defun ch-dim-text (/ ss i s1 lay mode)
  62.     (while (setq SS (ssget '((0 . "DIMENSION"))))
  63.       (setq i -1)
  64.       (while (setq s1 (ssname ss (setq i (1+ i))))
  65. (setq lay  (xyp-get-dxf 70 s1)
  66.        mode (xyp-get-dxf 0 s1)
  67. )
  68. (cond ((= mode "DIMENSION")
  69.         (if (and (/= lay 34) (/= lay 35) (/= lay 36) (/= lay 37))
  70.    (progn
  71.      (xyp-dim-dimblk "DI")
  72.      (command "dim" "UPD" s1 "" "Exit")
  73.    )
  74.    (progn
  75.      (xyp-dim-dimblk "AR")
  76.      (command "dim" "UPD" s1 "" "Exit")
  77.    )
  78.         )
  79.        )
  80.        ((or (= mode "TEXT") (= mode "MTEXT"))
  81.         (setq th     (xyp-get-dxf 40 s1)
  82.        #SCALE (/ xyp-bl #bl 1.0)
  83.         )
  84.         (xyp-SUBUPD s1 40 (* th #SCALE))
  85.        )
  86. )
  87.       )
  88.     )
  89.   )
  90.   (cmdlasc0)
  91.   (defun acc ()
  92.     (setq k15 (get_tile "k15"))
  93.     (if (= k15 "0")
  94.       (mode_tile "k16" 1)
  95.       (mode_tile "k16" 0)
  96.     )
  97.   )
  98.   (defun xyp-help () (alert "\n千万别打碎尺寸标注!"))
  99.   (if (< (getvar "DIMEXO") 200)
  100.     (progn
  101.       (setvar "DIMEXO" 200)
  102.       (setq dist-exo 200)
  103.     )
  104.   )
  105.   (if (or (< (getvar "DIMEXE") 200) (> (getvar "DIMEXE") 300))
  106.     (setvar "DIMEXE" 200)
  107.   )
  108.   (xyp-add-Block "DI")
  109.   (xyp-add-Block "AR")
  110.   (setq ctbl xyp-bl
  111. #bl  xyp-bl
  112.   )
  113.   (defun main-pro ()
  114.     (if (= k15 "1")
  115.       (progn
  116. (setq st (nth (atoi k16) lst))
  117. (setvar "DIMTXSTY" st)
  118.       )
  119.     )
  120.     (if (< dist-exo 200)
  121.       (setq dist-exo 200)
  122.     )
  123.     (setq xyp-bl ctbl)
  124.     (SETVAR "DIMLFAC" clbl)
  125.     (setvar "dimdec" (atoi jingdu))
  126.     (SETVAR "DIMTXT" high-txt)
  127.     (SETVAR "DIMEXO" dist-exo)
  128.     (SETVAR "dimadec" (getvar "dimdec"))
  129.     (main-bzsz)
  130.   )
  131.   (xyp-initSet
  132.     '(ctbl clbl jingdu high-txt dist-exo k15 k16)
  133.     '(100.0 1.0 "0" 300.0 200.0 "0" "0")
  134.   )
  135.   (setq lst  (xyp-list-style)
  136. lst1 '("0" "0.0" "0.00" "0.000" "0.0000")
  137. Ilst '(":row{"
  138.         ("k0" "" "imagebutton" "-2" "34" "xyp1964(bzsz)" "(XYP-ABOUTME)")
  139.         "spacer;"
  140.         ("" "参数" ":boxed_column{")
  141.         ("ctbl" "出图比例=1:" "real" "12")
  142.         ("clbl" "测量:标注=1:" "real" "12")
  143.         ":row{"
  144.         ("k15" "字型" "bool" "(acc)")
  145.         ("k16" "" "poplist" "lst" "11")
  146.         "}"
  147.         ("jingdu" "精度(DEC)" "poplist" "lst1" "11")
  148.         ("high-txt" "字高(TXT)" "real" "12")
  149.         ("dist-exo" "离开(EXO)" "real" "12")
  150.         "spacer;"
  151.         "}"
  152.         "}"
  153.         "spacer;"
  154.         "ioc"
  155.         ("" "" "user" "(acc)")
  156.        )
  157.   )
  158.   (if (= (xyp-Dcl-Init Ilst "【标注设置-bzsz】" t) 1)
  159.     (main-pro)
  160.   )
  161.   (cmdla1)
  162. )

本帖子中包含更多资源

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

x
发表于 2012-5-18 08:20:17 | 显示全部楼层
哈哈,院长不是说要发布源代码啊。

点评

标题说的是“逐步放出所有代码 ”,全放出来就是源代码了……  发表于 2012-5-18 12:43
发表于 2012-5-18 08:23:54 | 显示全部楼层
期待不在是伪源码
发表于 2012-5-18 08:35:19 | 显示全部楼层
没有裤,有裤更好!
发表于 2012-5-18 10:32:39 | 显示全部楼层
支持院长。
发表于 2012-5-18 10:33:57 | 显示全部楼层
院长,,,先发个三维标注给用下。。。谢谢。。。!!!!!!!
发表于 2012-5-18 10:38:32 | 显示全部楼层
院长很强大
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-19 08:26 , Processed in 0.248037 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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