www.pudn.com > CADtool.rar > PingTuXiang.lsp, change:2009-12-06,size:4767b


;;;绘制拼图线 
(defun c:Road_PingTuXiang (/ floatBasicAngle listBasicPoint listDirectionPoint listBasicPointWCS listDirectionPointWCS 
                             intStartPageNumber intNextPageNumber strTextPrinted floatTextAngle 
                             listStartPoint listEndPoint listMidPoint listTextInsertPoint 
                             intChuTuBiLi floatBiLi ) 
 (setvar "osmode" 431) 
 (princ "\n本程序用于在模型空间下绘接图线!") 
 (initget 6) 
 (setq intChuTuBiLi (if (setq intChuTuBiLi  (getint "\n输入出图比例1:[500/1000/2000]<1000>:")) 
                          intChuTuBiLi 
                          1000 
                      ) 
 ) 
;;; 出图比例为1/intChuTuBiLi 
(setq floatBiLi (/ intChuTuBiLi 1000.0 )) ;接图线相关线长及字高的缩放系数 
 
 (initget 6) 
 (setq intStartPageNumber (if (setq intStartPageNumber  (getint "\n输入起始页页码<1>:")) 
                          intStartPageNumber 
                          1 
                      ) 
 ) 
  
 (if (tblsearch "style" "排水标注") 
  ;;判断是否存在"排水标注"字体,有则设为当前,无则创建。 
  (setvar "textstyle" "排水标注") 
  (command "_style" "排水标注" "hztxt_e.shx,hztxt.shx" 0 0.8 0 "N" "N" "N") 
 )  
  
 (while (setq listBasicPoint (getpoint "\n选择接图线中心点:"))   
  (if (setq listDirectionPoint (getpoint listBasicPoint "\n选择接图线正方向上一点:")) 
   (progn 
    (BeginUndoGroup) 
    (setq listBasicPointWCS (trans listBasicPoint 1 0) ) 
    (setq listDirectionPointWCS (trans listDirectionPoint 1 0) ) 
    (setq floatBasicAngle (angle listBasicPointWCS listDirectionPointWCS)) 
    (setq floatTextAngle (- floatBasicAngle (/ pi 2)) ) 
    (setq intNextPageNumber (1+ intStartPageNumber)) 
    (setvar "osmode" 0) 
   
  (setq listStartPoint (polar listBasicPointWCS floatBasicAngle  (* floatBiLi  108))) 
  (setq listEndPoint (polar listBasicPointWCS floatBasicAngle  (* floatBiLi  -108))) 
  (AddLine listStartPoint listEndPoint ) 
  ;;画主线 
   
  (setq listMidPoint (polar listBasicPointWCS floatBasicAngle  (* floatBiLi  100))) 
  (setq listStartPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  8))) 
  (setq listEndPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  -8))) 
  (AddLine listStartPoint listEndPoint ) 
  ;;画顶部文字下直线 
   
  (setq listTextInsertPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  4))) 
  (setq listTextInsertPoint (polar listTextInsertPoint floatBasicAngle  (* floatBiLi 1)))  
  (AddText_AlignmentMiddle listTextInsertPoint (* floatBiLi 4 ) floatTextAngle (itoa intStartPageNumber) 0.8  "排水标注") 
  ;;顶部首页码 
   
  (setq listTextInsertPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  -4))) 
  (setq listTextInsertPoint (polar listTextInsertPoint floatBasicAngle  (* floatBiLi 1)))  
  (AddText_AlignmentMiddle listTextInsertPoint (* floatBiLi 4 ) floatTextAngle (itoa intNextPageNumber) 0.8  "排水标注") 
  ;;顶部次页码 
   
  (setq strTextPrinted "接图线") 
  (setq listTextInsertPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  1))) 
  (setq listTextInsertPoint (polar listTextInsertPoint floatBasicAngle  (* floatBiLi -10)))  
  (AddText_AlignmentMiddle listTextInsertPoint (* floatBiLi 4 ) floatBasicAngle strTextPrinted 0.8  "排水标注") 
  ;; 顶部 "接图纸" 文字 
   
  (setq listMidPoint (polar listBasicPointWCS floatBasicAngle  (* floatBiLi  -100))) 
  (setq listStartPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  8))) 
  (setq listEndPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  -8))) 
  (AddLine listStartPoint listEndPoint ) 
  ;;画底部文字下直线 
   
  (setq listTextInsertPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  4))) 
  (setq listTextInsertPoint (polar listTextInsertPoint floatBasicAngle  (* floatBiLi -5)))  
  (AddText_AlignmentMiddle listTextInsertPoint (* floatBiLi 4 ) floatTextAngle (itoa intStartPageNumber) 0.8  "排水标注") 
  ;;底部首页码 
   
  (setq listTextInsertPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  -4))) 
  (setq listTextInsertPoint (polar listTextInsertPoint floatBasicAngle  (* floatBiLi -5)))  
  (AddText_AlignmentMiddle listTextInsertPoint (* floatBiLi 4 ) floatTextAngle (itoa intNextPageNumber) 0.8  "排水标注") 
  ;;底部次页码   
 
  (setq listTextInsertPoint (polar listMidPoint (+ floatBasicAngle (/ pi 2)) (* floatBiLi  1))) 
  (setq listTextInsertPoint (polar listTextInsertPoint floatBasicAngle  (* floatBiLi 10)))  
  (AddText_AlignmentMiddle listTextInsertPoint (* floatBiLi 4 ) floatBasicAngle strTextPrinted 0.8  "排水标注") 
  ;; 底部 "接图纸" 文字 
   
  (setq intStartPageNumber intNextPageNumber) 
  (setvar "osmode" 431) 
  (EndUndoGroup) 
   ) 
  ) 
 ) 
 (princ) 
)