明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 868|回复: 0

[提问] cad标注问题(一个开源程序)

[复制链接]
发表于 2015-8-18 15:57:09 | 显示全部楼层 |阅读模式
桥梁上面的一个插件,在使用  钢束大样   标注时,一直用不了:提示  
”选择水平标注位置:; 错误: 参数类型错误: numberp: nil “。

程序为 同济建筑设计院的 开源程序,已联系不上作者。求高手看看。
  1. ———— 预应力工具
  2. ;;;===============================================================================
  3. ;;;-------------------------------------------------------------------------------
  4. ;;; 钢束初始化
  5. ;;; 功能:定义钢束
  6. ;;;-------------------------------------------------------------------------------
  7. (defun c:gscsh(/ id whatnext tendonno count tcount tendonid tendonsty tendonstylst constress prelength orientstyle position symmertry
  8.         ename entlst vlaobj pto orient ptold orientold orientucs tcountold)
  9.   (defun showerrtile()
  10.     (cond
  11.       ((or (null ename)(/= "LWPOLYLINE" (cdr (assoc 0 (entget ename)))))
  12.         (mode_tile "accept" 1)
  13.         (set_tile "error" "未选中有效曲线!"))
  14.       (t
  15.         (mode_tile "accept" 0)
  16.         (set_tile "error" "OK!"))))
  17.   (setq id            (load_dialog "BRTools.dcl")
  18.       tendonstylst '((0 . "15.20") (1 . "12.70") (2 . "11.10") (3 . "9.50") (4 . "JL18") (5 . "JL25") (6 . "JL32") (7 . "JL40")))
  19.   (mapcar 'set '(whatnext tendonno count tcount constress prelength orientstyle position symmertry tendonid tendonsty) '(2 "N1" 1 12 1395 700 "currentucs" "both" "0" 0 "15.20"))
  20.   (setq pto      '(0.0 0.0 0.0)
  21.       ptold     pto
  22.       orient    (MAT:UnitVec2P '(0.0 0.0 0.0) (append (mapcar '+ '(0.0 0.0) (getvar "UCSXDIR")) '(0.0)))
  23.       orientold orient
  24.       orientucs orient
  25.       tcountold tcount)
  26.   (while (>= whatnext 2)
  27.     (new_dialog "SETTENDON" id)
  28.     (mapcar 'set_tile
  29.       '("tendonno" "count" "tendonsty" "constress" "prelength" "orientstyle" "position" "symmertry" "originmsg" "orientmsg")
  30.       (list tendonno (itoa count) (itoa tendonid) (rtos constress 2) (rtos prelength 2) orientstyle position symmertry (vl-princ-to-string pto) (vl-princ-to-string orient)))
  31.     (LT:BUTTON-POINT-PICK "pickorigin" T)
  32.     (LT:BUTTON-SELECT-PICK "picktondon" T)
  33.     (if (= "currentucs" orientstyle)
  34.       (progn
  35.         (mode_tile "pickorient" 1)
  36.         (LT:BUTTON-POINT-PICK "pickorient" nil))
  37.       (progn
  38.         (mode_tile "pickorient" 0)
  39.         (LT:BUTTON-POINT-PICK "pickorient" T)))
  40.     (if (> tendonid 3)
  41.       (progn (mode_tile "tcount" 1) (set_tile "tcount" (itoa tcountold)))
  42.       (progn (mode_tile "tcount" 0) (set_tile "tcount" (itoa tcount))))
  43.     (showerrtile)
  44.     (action_tile "tendonno" "(setq tendonno $value)")
  45.     (action_tile "count" "(setq count (atoi $value))")
  46.     (action_tile "tcount" "(setq tcount (atoi $value))")
  47.     (action_tile "tendonsty" "(setq tendonid (atoi $value) tendonsty (cdr (assoc tendonid tendonstylst)))(if (> (atoi $value) 3) (progn (mode_tile "tcount" 1) (setq tcountold tcount tcount 0))(progn (mode_tile "tcount" 0) (setq tcount tcountold)))")
  48.     (action_tile "constress" "(setq constress (atof $value))")
  49.     (action_tile "prelength" "(setq prelength (atof $value))")
  50.     (action_tile "currentucs" "(setq orientstyle (get_tile "orientstyle") orientold orient orient orientucs)(set_tile "orientmsg" (vl-princ-to-string orient))(mode_tile "pickorient" 1)(LT:BUTTON-POINT-PICK "pickorient" nil)")
  51.     (action_tile "manualorient" "(setq orientstyle (get_tile "orientstyle") orient orientold ) (set_tile "orientmsg" (vl-princ-to-string orient)) (mode_tile "pickorient" 0)(LT:BUTTON-POINT-PICK "pickorient" T)")
  52.     (action_tile "start" "(setq position (get_tile "position"))(mode_tile "symmetry" 1)(setq symmetry "0")")
  53.     (action_tile "end" "(setq position (get_tile "position"))(mode_tile "symmetry" 1)(setq symmetry "0")")
  54.     (action_tile "both" "(setq position (get_tile "position"))(mode_tile "symmetry" 0)(setq symmetry (get_tile "symmertry"))")
  55.     (action_tile "symmetry" "(setq symmertry $value)")
  56.     (action_tile "pickorient" "(done_dialog 4)")
  57.     (action_tile "pickorigin" "(done_dialog 3)")
  58.     (action_tile "picktondon" "(done_dialog 2)")
  59.     (action_tile "help" "(help "BRTools" "4_cmd_04_01_gscsh")")
  60.     (setq whatnext (start_dialog))
  61.     (cond
  62.       ((= 4 whatnext)
  63.         (setq orientold orient)
  64.         (if (setq orient (getpoint (trans pto 0 1) "\n选择方向:"))
  65.           (setq orient    (append (mapcar '+ '(0.0 0.0) (trans orient 1 0)) '(0.0))
  66.               orient    (MAT:UnitVec2P pto orient)
  67.               orientold orient)
  68.           (setq orient orientold)))
  69.       ((= 3 whatnext)
  70.         (setq ptold pto)
  71.         (if (setq pto   (getpoint "\n请输入钢束参考点:"))  
  72.           (setq pto   (append (mapcar '+ '(0.0 0.0) (trans pto 1 0)) '(0.0))
  73.               ptold pto)
  74.           (setq pto ptold)))
  75.       ((= 2 whatnext)
  76.         (and
  77.           (setq ename (car (entsel "\n选择一条曲线:")))
  78.           (CK:TendonP ename)
  79.           (mapcar
  80.             '(lambda(x1 x2 x3) (set x1 (BR:GetXdata ename x2 x3)))
  81.             '(tendonno tendonsty tcount count prelength constress position symmetry)
  82.             '(1000 1000 1070 1070 1040 1040 1000 1000)
  83.             '("tendonno" "tendonsty" "tcount" "count" "prelength" "constress" "tenposition" "symmetrystyle"))
  84.           (setq pto    (BR:GetOrigin ename)
  85.               orient (BR:GetOrient ename))))
  86.       ((= 1 whatnext)
  87.         (LA:Rebar)
  88.         (setq entlst (entget ename)
  89.             vlaobj (vlax-ename->vla-object ename)
  90.             entlst (subst (cons 8 "REBAR") (assoc 8 entlst) entlst))
  91.         (entmod entlst)
  92.         (and (minusp (MAT:DotProduct orient (mapcar '- (vlax-curve-getEndPoint vlaobj) (vlax-curve-getStartPoint vlaobj)))) (MD:RevLwPl ename))
  93.         (mapcar
  94.           '(lambda(x1 x2 x3) (BR:SetXdata ename x1 x2 x3))
  95.           '(1000 1000 1070 1070 1040 1040 1000 1000)
  96.           '("tendonno" "tendonsty" "tcount" "count" "prelength" "constress" "tenposition" "symmetrystyle")
  97.           (list tendonno tendonsty tcount count prelength constress position symmertry))
  98.         (BR:SetOrigin ename pto)
  99.         (BR:SetOrient ename orient))
  100.       ((= 0 whatnext)(princ "\n操作取消!"))))
  101.   (unload_dialog id)
  102.   (princ))  
  103. ;;;-------------------------------------------------------------------------------
  104. ;;; 钢束大样
  105. ;;; 功能:对预应力钢束大样进行标注
  106. ;;;-------------------------------------------------------------------------------
  107. (defun c:gsdy (/ ename refename pt prolst dstyle)
  108.   (and
  109.     (setq ename (car (entsel "\n请选择钢束曲线:")))
  110.     (progn
  111.       (redraw ename 3)
  112.       (= "LWPOLYLINE" (cdr (assoc 0 (entget ename)))))
  113.     (setq refename (car (entsel "\n请选择标注参考线:")))
  114.     (progn
  115.       (redraw refename 3)
  116.       (member (cdr (assoc 0 (entget refename))) '("LWPOLYLINE" "LINE")))
  117.     (cond
  118.       ((CK:TendonP ename)(setq prolst (list (BR:GetOrient ename) (BR:GetXdata ename 1040 "prelength") (BR:GetXdata ename 1000 "tenposition") (BR:GetXdata ename 1000 "symmetrystyle"))))
  119.       (t (setq prolst (DL:GetTondonProLst '((0 . 700) (1 . "both") (2 . "1"))))))
  120.     (setq pt (trans (getpoint "\n选择水平标注位置:") 1 0))
  121.     (setq dstyle (getvar "DIMSTYLE"))
  122.     (progn
  123.       (or (tblsearch "DIMSTYLE" (strcat dstyle "$4")) (DSTYLE:Radial-Current))
  124.       (LA:CurNote)
  125.       (LA:CurCEN)
  126.       (LA:CurDim)
  127.       (LA:Rebar)
  128.       (BLK:PRESANCHOR)
  129.       (BLK:PRESTENSION)
  130.       (SET:SC))
  131.     (DR:TondonDim ename refename pt dstyle prolst))
  132.   (and ename (redraw ename 4))
  133.   (and refename (redraw refename 4))
  134.   (princ))
  135. ;;;-------------------------------------------------------------------------------
  136. ;;; 钢束导线
  137. ;;; 功能:画出钢束导线
  138. ;;;-------------------------------------------------------------------------------
  139. (defun c:gsdx(/ r ss ename entlst i)
  140.   (setq r    (getvar "FILLETRAD"))
  141.   (and
  142.     (setq ss (ssget '((0 . "LWPOLYLINE"))))
  143.     (progn
  144.       (LA:CurCen)
  145.       (setvar "CMDECHO" 0)
  146.       (setvar "FILLETRAD" 0.0)
  147.       (setq i 0))
  148.     (repeat (sslength ss)
  149.       (setq entlst (entget (ssname ss i))
  150.           i      (1+ i)
  151.           entlst (vl-remove-if '(lambda(x) (member (car x) '(-1 5 330 ))) entlst))
  152.       (entmake entlst)
  153.       (setq ename (entlast))
  154.       (vl-cmdf "fillet" "P" ename)
  155.       (vlax-put-property (vlax-ename->vla-object ename) 'LAYER *CLACEN*))
  156.     (setvar "FILLETRAD" r))
  157.   (princ))
  158. ;;;-------------------------------------------------------------------------------
  159. ;;; 钢束放样
  160. ;;; 功能:
  161. ;;;-------------------------------------------------------------------------------
  162. (defun c:gsfy()
  163.   (princ))
  164. ;;;-------------------------------------------------------------------------------
  165. ;;;===============================================================================
  166. ;;;菜单命令 ———— 钢结构工具
  167. ;;;===============================================================================

本帖子中包含更多资源

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

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

本版积分规则

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

GMT+8, 2024-11-23 07:02 , Processed in 0.149676 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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