明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 34114|回复: 96

TrueTable(破解) .

  [复制链接]
发表于 2010-6-5 06:32:00 | 显示全部楼层 |阅读模式
本帖最后由 429014673 于 2021-4-12 11:12 编辑












本帖子中包含更多资源

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

x
发表于 2021-6-10 16:56:12 | 显示全部楼层
TrueTable(破解),niubi
发表于 2021-3-26 21:09:05 | 显示全部楼层
威武霸气。。牛逼啊
发表于 2020-5-27 17:30:01 | 显示全部楼层
威武霸气,牛逼啊
 楼主| 发表于 2010-6-5 06:57:00 | 显示全部楼层
本帖最后由 作者 于 2010-6-5 7:24:38 编辑

(defun c:q2()
      (setq var1 (getvar "osmode")
     var2 (getvar "dimassoc" ))
      (setvar "cmdecho" 0 )(setvar "osmode" 0)(setvar "dimassoc" 2)
           di (getreal":\nInput The Distance Between The Object And Dimension Line...")
            n (1- (sslength sg))
     )
       (while (setq  sn (ssname sg n)
       ent (entget sn)
       )
        (cond ((=  (cdr(assoc 0 ent)) "LINE") (diml))
       ((=  (cdr(assoc 0 ent)) "ARC" ) (progn(dimr)(dimarc)))
       ((=  (cdr(assoc 0 ent)) "POLYLINE" ) (dimsp sn di))
       )
  (setq n (1- n))
  )
     .........

评分

参与人数 1明经币 +1 收起 理由
mccad + 1 【好评】表扬一下

查看全部评分

 楼主| 发表于 2010-6-5 07:03:00 | 显示全部楼层
本帖最后由 作者 于 2010-6-5 7:24:15 编辑

再放一条

查找手動修改過的尺寸(RF)

 ;-----------------------------------------------------------------
 (defun c:RF ( )    ;Real Find,用于查找客戶原圖中手動修改過的尺寸
  (COMMAND "UCS" "W")
  (princ "查找手動修改過的尺寸")
  (SETQ COUNTOR 0)
  (SETQ DIMSTRING "here")
  (PROMPT "\n指示查找區域(確認對象不是一個塊!):")
  (SETVAR "OSMODE" 0)(SETVAR "ORTHOMODE" 0)
  (SETQ ENTGRP (SSGET))
  (SETQ COUNT 0)                                         
  .........

点评

一不小心,好评了,但发现源码不全,请补全  发表于 2010-6-5 00:00

评分

参与人数 1明经币 +1 收起 理由
mccad + 1 【好评】表扬一下

查看全部评分

 楼主| 发表于 2010-6-5 07:04:00 | 显示全部楼层
剖視&放大(CCS)
--------------------------------------------------------------
  1. (defun c:ccs (/ sym ssy sc snum systr scstr txtpnt numstr n cnt i txtlst oldtxt oldlay ent scpnt diment dimn measur
  2.               newtxt prec dimtyp
  3.              )
  4.    (setvar "cmdecho" 0)
  5.    (grtext -1 "該程序是用以將剖視圖(或放大圖)的尺寸自動從默認值變成實測值,再放大它並插入標示.")
  6.    (setq ssy (getstring "\nThe section symbol is:"))
  7.    (setq systr nil
  8.          scstr nil
  9.          numstr nil
  10.    ) ;_ 結束setq
  11.    ;;If no section symbol,then just make the measurement of the dimension.
  12.    (IF (/= ssy "")
  13.       (progn
  14.          ;;(initget 128 "Detail Section")
  15.          (setq sym (getstring "\n是剖視圖還是放大圖?Detail/<Section>:"))
  16.          (if (or (= sym "") (= sym "s"))                    ;presume it as section view
  17.             (setq systr (strcat "SECTION " ssy "-" ssy)
  18.                   systr (strcase systr) ;|insure the input cha. is uppercase.|;
  19.             ) ;_ 結束setq
  20.             (setq systr (strcat "DETAIL " ssy)
  21.                   systr (strcase systr)
  22.             ) ;_ 結束setq
  23.          ) ;_ 結束if
  24.          (setq sc (getstring "\nThe section scale?(needed to be integers)"))
  25.          ;| access the number of places to be scaled.|;
  26.          (setq snum (getstring "\nHow many places?(needed to be integers)"))
  27.          (if (> (atoi snum) 1)
  28.             (setq numstr (strcat snum "PLS")
  29.                   numstr (strcase numstr)
  30.             ) ;_ 結束setq
  31.          ) ;_if just 1 place,not display it.
  32.       ) ;_ 結束progn
  33.    ) ;_ 結束IF
  34.    (grtext -1 "Please select the dimension object...")
  35.    (setq ent (ssget))
  36.    (setq diment (ssget "p" '((0 . "dimension")))
  37.          n      (sslength diment)
  38.    ) ;_ 結束setq
  39.    (princ (strcat "\n*** Total " (itoa n) " dimensions to be selected. ***"))
  40.    (setq cnt 0
  41.          i 0
  42.    ) ;_reset countor and list NO.
  43.    (while (PROGN (grtext -1 "OK.Modifying the dimension...")
  44.                  (< i n)
  45.           )                                                 ;逐一搜索標注實體.
  46.       (setq dimn (entget (ssname diment i)))                ;取得實體.
  47. ;;;->(setq dimn (entget (car (entsel))))                   ;取得實體數據表.
  48.       (setq oldtxt (cdr (assoc 1 dimn))
  49.             dimtyp (cdr (assoc 100 (reverse dimn)))
  50.       ) ;_ 結束setq
  51.       (if (and (or (wcmatch oldtxt "*<>*") (= oldtxt ""))
  52.                (wcmatch dimtyp "~*Angular*")
  53.           ) ;_ 結束and
  54.           ;|只有是非角度尺寸,才用實測值代替默認值. |;
  55.          (progn
  56.             (setq measur (C42 dimn) ;|***調用函數c42(ent).|;
  57.                   prec   (getvar "dimdec")
  58.                   measur (rtos measur 2 prec) ;|將測量值從實數變成字串|;
  59.             ) ;_ 結束setq
  60.             (cond ((wcmatch dimtyp "*Diametric*") (setq measur (strcat "%%c" measur)))
  61.                                                             ; _若是直徑,則在數字前加直徑符號"%%c"
  62.                   ((wcmatch dimtyp "*Radial*") (setq measur (strcat "R" measur))) ;_若是半徑,則在數字前加半徑符號R.
  63.             ) ;_ 結束cond
  64.             (if (wcmatch oldtxt "*<>*")
  65.                (setq newtxt (subst_str measur "<>" oldtxt)) ;|只替代默認值部分.***調用函數subst_str(newstr oldstr str)|;
  66.                (setq newtxt measur)
  67.             ) ;_ 結束if
  68.             (setq dimn (subst (cons 1 newtxt) (cons 1 oldtxt) dimn))
  69.             (entmod dimn)
  70.             (setq cnt (1+ cnt))
  71.          ) ;_ 結束progn
  72.       ) ;_ 結束if
  73.       (setq i (1+ i))                                       ;search the next dimension.
  74.    ) ;_ 結束while
  75.    (princ (strcat "\n*** Just " (itoa cnt) " dimensions modified! ***"))
  76.    ;;if the scale is 1:1,not to scale it.
  77.    (if (/= sc "")
  78.       (if (> (atoi sc) 1)
  79.          (progn (setq scpnt (getpoint "\nInput the scale center point:"))
  80.                 (command "._scale" ent "" scpnt (atof sc))
  81.                 (setq scstr (strcat "SCALE " sc ":1") ;_ if it's 1:1(no input),not to display it
  82.                       scstr (strcase scstr)
  83.                 ) ;_ 結束setq
  84.          ) ;_ 結束progn
  85.       ) ;_ 結束if
  86.    ) ;_ 結束IF
  87.    (if (or systr scstr numstr)
  88.       (progn
  89.          (setq txtpnt (getpoint "\nWhere to place the note?"))
  90.          (setq oldlay (getvar "clayer"))
  91.          (if (tblsearch "layer" "mark")
  92.             (setvar "clayer" "mark")
  93.          ) ;_ 結束IF
  94.          (command "._text" "s" "standard" "j" "mc" txtpnt (* 2.5 (getvar "dimscale")) "0" systr "")
  95.          (if scstr
  96.             (command "._text" "" scstr)
  97.          ) ;_ 結束if
  98.          (if numstr
  99.             (command "._text" "" numstr)
  100.          ) ;_ 結束if
  101.                                                             ;(command)
  102.          (setvar "clayer" oldlay)
  103.       ) ;_ 結束PROGN
  104.    ) ;_ 結束IF
  105.    (setvar "cmdecho" 1)
  106.    (grtext)
  107.    (princ)
  108. ) ;_ 結束defun
  109. ;;;---------SUBPROGRAMM---------------
  110. ;;;This pro. is to make the linear dimension's measurement.
  111. (defun c42 (ent / p1x p1y p2x p2y dy v ang dimtyp dx p1 p2 dimtyp)
  112.    (setq dimtyp (cdr (assoc 70 ent))
  113.          dimtyp (logand dimtyp 7)
  114.    ) ;_ 結束setq
  115.    (cond
  116.       ;;aligned&rotateddimension
  117.       ((= dimtyp 0)
  118.        (progn
  119.           (setq p1  (assoc 13 ent)
  120.                 p2  (assoc 14 ent)
  121.                 p1x (nth 1 p1)
  122.                 p1y (nth 2 p1)
  123.                 p2x (nth 1 p2)
  124.                 p2y (nth 2 p2)
  125.                 dx  (abs (- p1x p2x))
  126.                 dy  (abs (- p1y p2y))
  127.                 ang (cdr (assoc 50 ent))
  128.           ) ;_ 結束setq
  129.           (if (= ang 0)
  130.              (setq v dx)
  131.              (setq v dy)
  132.           ) ;_ 結束if
  133.        ) ;_ 結束progn
  134.       ) ;_case 1
  135.       ;;aligneddimension
  136.       ((= dimtyp 1)
  137.        (setq p1 (assoc 13 ent)
  138.              p2 (assoc 14 ent)
  139.              v  (distance (cdr p1) (cdr p2))
  140.        ) ;_ 結束setq
  141.       ) ;_case 2
  142.       ;;radialdimension & diametricdimension
  143.       ((or (= dimtyp 4) (= dimtyp 3))
  144.        (setq p1 (assoc 10 ent)
  145.              p2 (assoc 15 ent)
  146.              v  (distance (cdr p1) (cdr p2))                ;取得數值v作為函數值.            
  147.        ) ;_ 結束setq
  148.       ) ;_case 3
  149.    ) ;_ 結束cond
  150. ) ;_ 結束defun
  151. ;;;;-SUBROTINE 2------
  152. ;;;This pro. is to substitute a new string for the old string in the source string.
  153. (defun subst_str (newstr oldstr str / i k k1 k2 n tmpstr stre strf)
  154.    (setq k1 (strlen str)
  155.          k2 (strlen oldstr)
  156.          k  (1+ (- k1 k2))
  157.          i  1
  158.          n  nil
  159.    ) ;_ 結束setq
  160.    (while (<= i k)
  161.       (setq tmpstr (substr str i k2))
  162.       (if (= tmpstr oldstr)
  163.          (progn
  164.             (setq n i
  165.                   i (1+ k)
  166.             )                                               ;set the loop-off condition to end the loop
............

评分

参与人数 1明经币 +2 收起 理由
mccad + 2 【好评】表扬一下

查看全部评分

 楼主| 发表于 2010-6-5 07:05:00 | 显示全部楼层
本帖最后由 作者 于 2010-6-5 7:25:35 编辑

圖元縮放,尺寸不變(RS)
;-----------------------------------------------------------------
 (defun c:RS ( )               ;Real Scale,用于畫剖視圖縮放圖元時,維持標注尺寸不變
  (princ "圖元縮放,尺寸不變")
  (PROMPT "\n指示縮放區域:")
  (SETVAR "OSMODE" 0)(SETVAR "ORTHOMODE" 0)
  (setq scale (ssget ))
  (SETQ ENTGRP scale)
  (SETQ COUNT 0)                                        
  (REPEAT (SSLENGTH ENTGRP)
    (SETQ ENTNAME (SSNAME ENTGRP COUNT))
    (SETQ ENT (ENTGET ENTNAME))
    (IF (AND (= (CDR (ASSOC 0 ENT)) "DIMENSION")       
             (/= (cdr (ASSOC 1 ENT)) ""))    
       (PROGN (PRINC "\n對象中不能有修改過的尺寸!") (EXIT)))
       (IF (and(= (CDR (ASSOC 0 ENT)) "DIMENSION")                ;AlignedDimension
            (= (cdr (nth 19 ent)) "AcDbAlignedDimension"))      
          (PROGN
              (setq P1 (assoc 13 ENT))
              (setq P2 (assoc 14 ENT))
              (setq P1x (nth 1 P1)) 
              (setq P1y (nth 2 P1))                  
              (setq P2x (nth 1 P2))
              (setq P2y (nth 2 P2))
              (setq DX (ABS(- P1x P2x)))          
              (setq DY (ABS(- P1y P2y)))           
              (setq SS (assoc 10 ENT))
              (setq TT (assoc 11 ENT))
              (setq SSx (nth 1 SS)) 
              (setq TTx (nth 1 TT))
              (setq SSy (nth 2 SS)) 
              (setq TTy (nth 2 TT))   
              (IF (= SSx TTx)                   
                 (setq V Dy))
              (IF (and(/= SSx TTx)(= SSy TTy))
                 (setq V Dx))                                      ;取得數值V1
              (IF (and(/= SSx TTx)(/= SSy TTy))
                 (setq V (distance (cdr p1) (cdr p2))))             
              (SETQ W (rtos V 2 2))
              (SETQ ENT (SUBST (CONS 1 W) (ASSOC 1 ENT) ENT))       ;MODIFY
              (ENTMOD ENT)                                          ;UPDATE
          )
      )
    (IF (and(= (CDR (ASSOC 0 ENT)) "DIMENSION")                    ;RadialDimension
            (= (cdr (nth 19 ent)) "AcDbRadialDimension"))
          (PROGN
              (setq P1 (assoc 10 ENT))
              (setq P2 (assoc 15 ENT))
              (setq V (distance (cdr p1) (cdr p2)))                ;取得數值V1           
              (SETQ W (strcat "R" (rtos V 2 2)))
              (SETQ ENT (SUBST (CONS 1 W) (ASSOC 1 ENT) ENT))       ;MODIFY
              (ENTMOD ENT)                                          ;UPDATE
          )
      )
  (SETQ COUNT (1+ COUNT))
..........
 楼主| 发表于 2010-6-5 07:06:00 | 显示全部楼层

..........

 楼主| 发表于 2010-6-5 07:28:00 | 显示全部楼层

 

本帖子中包含更多资源

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

x
 楼主| 发表于 2010-6-5 07:56:00 | 显示全部楼层

标注弧长、半径、线段

(defun c:q2()
      (setq var1 (getvar "osmode")
     var2 (getvar "dimassoc" ))
      (setvar "cmdecho" 0 )(setvar "osmode" 0)(setvar "dimassoc" 2)
      (princ "\nChoose Objects You Want To Auto Make Dimensions...")
      (setq sg (ssget)
     di (getreal":\nInput The Distance Between The Object And Dimension Line...")
            n (1- (sslength sg))
     )
       (while (setq  sn (ssname sg n)
       ent (entget sn)
       )
        (cond ((=  (cdr(assoc 0 ent)) "LINE") (diml))
       ((=  (cdr(assoc 0 ent)) "ARC" ) (progn(dimr)(dimarc)))
       ((=  (cdr(assoc 0 ent)) "POLYLINE" ) (dimsp sn di))
       )
  (setq n (1- n))
  )
        (command)
        (setvar "cmdecho" 1)
        (setvar "dimassoc" var2 )
        (setvar "osmode" var1)
        (princ"\nByoend Ever You Thinking...")
  )

 楼主| 发表于 2010-6-5 08:02:00 | 显示全部楼层
(defun c:RF ( )    ;Real Find,用于查找客戶原圖中手動修改過的尺寸
  (COMMAND "UCS" "W")
  (princ "查找手動修改過的尺寸")
  (SETQ COUNTOR 0)
  (SETQ DIMSTRING "here")
  (PROMPT "\n指示查找區域(確認對象不是一個塊!):")
  (SETVAR "OSMODE" 0)(SETVAR "ORTHOMODE" 0)
  (SETQ ENTGRP (SSGET))
  (SETQ COUNT 0)                                        
  (REPEAT (SSLENGTH ENTGRP)
    (SETQ ENTNAME (SSNAME ENTGRP COUNT))
    (SETQ ENT (ENTGET ENTNAME))
    (IF (AND (= (CDR (ASSOC 0 ENT)) "DIMENSION")       
             (/= (cdr (ASSOC 1 ENT)) ""))             
      (PROGN
        (SETQ TXTPT (CDR (ASSOC 11 ENT)))                
        (SETQ OLDLAYER (GETVAR "CLAYER"))
        (COMMAND "-LAYER" "S" "MARK" "")              
        (COMMAND "_.TEXT" "J" "C" TXTPT (* 5.0 (GETVAR "DIMSCALE")) "" (strcase DIMSTRING t))
        (COMMAND "-LAYER" "S" OLDLAYER "")
        (SETQ COUNTOR (1+ COUNTOR))                   
      )
    )
    (SETQ COUNT (1+ COUNT))
  )
  (COMMAND "_UCS" "P")
  (PRINC "\n OK! 找到 ")(PRINC COUNTOR) (PRINC " 個手動修改過的尺寸!")
  (PRINC)
)
 楼主| 发表于 2010-6-5 08:03:00 | 显示全部楼层

(defun c:ccs (/ sym ssy sc snum systr scstr txtpnt numstr n cnt i txtlst oldtxt oldlay ent scpnt diment dimn measur
              newtxt prec dimtyp
             )
   (setvar "cmdecho" 0)
   (grtext -1 "該程序是用以將剖視圖(或放大圖)的尺寸自動從默認值變成實測值,再放大它並插入標示.")
   (setq ssy (getstring "\nThe section symbol is:"))
   (setq systr nil
         scstr nil
         numstr nil
   ) ;_ 結束setq
   ;;If no section symbol,then just make the measurement of the dimension.
   (IF (/= ssy "")
      (progn
         ;;(initget 128 "Detail Section")
         (setq sym (getstring "\n是剖視圖還是放大圖?Detail/<Section>:"))
         (if (or (= sym "") (= sym "s"))                    ;presume it as section view
            (setq systr (strcat "SECTION " ssy "-" ssy)
                  systr (strcase systr) ;|insure the input cha. is uppercase.|;
            ) ;_ 結束setq
            (setq systr (strcat "DETAIL " ssy)
                  systr (strcase systr)
            ) ;_ 結束setq
         ) ;_ 結束if
         (setq sc (getstring "\nThe section scale?(needed to be integers)"))
         ;| access the number of places to be scaled.|;
         (setq snum (getstring "\nHow many places?(needed to be integers)"))
         (if (> (atoi snum) 1)
            (setq numstr (strcat snum "PLS")
                  numstr (strcase numstr)
            ) ;_ 結束setq
         ) ;_if just 1 place,not display it.
      ) ;_ 結束progn
   ) ;_ 結束IF
   (grtext -1 "Please select the dimension object...")
   (setq ent (ssget))
   (setq diment (ssget "p" '((0 . "dimension")))
         n      (sslength diment)
   ) ;_ 結束setq
   (princ (strcat "\n*** Total " (itoa n) " dimensions to be selected. ***"))
   (setq cnt 0
         i 0
   ) ;_reset countor and list NO.
   (while (PROGN (grtext -1 "OK.Modifying the dimension...")
                 (< i n)
          )                                                 ;逐一搜索標注實體.
      (setq dimn (entget (ssname diment i)))                ;取得實體.
;;;->(setq dimn (entget (car (entsel))))                   ;取得實體數據表.
      (setq oldtxt (cdr (assoc 1 dimn))
            dimtyp (cdr (assoc 100 (reverse dimn)))
      ) ;_ 結束setq
      (if (and (or (wcmatch oldtxt "*<>*") (= oldtxt ""))
               (wcmatch dimtyp "~*Angular*")
          ) ;_ 結束and
          ;|只有是非角度尺寸,才用實測值代替默認值. |;
         (progn
            (setq measur (C42 dimn) ;|***調用函數c42(ent).|;
                  prec   (getvar "dimdec")
                  measur (rtos measur 2 prec) ;|將測量值從實數變成字串|;
            ) ;_ 結束setq
            (cond ((wcmatch dimtyp "*Diametric*") (setq measur (strcat "%%c" measur)))
                                                            ; _若是直徑,則在數字前加直徑符號"%%c"
                  ((wcmatch dimtyp "*Radial*") (setq measur (strcat "R" measur))) ;_若是半徑,則在數字前加半徑符號R.
            ) ;_ 結束cond
            (if (wcmatch oldtxt "*<>*")
               (setq newtxt (subst_str measur "<>" oldtxt)) ;|只替代默認值部分.***調用函數subst_str(newstr oldstr str)|;
               (setq newtxt measur)
            ) ;_ 結束if
            (setq dimn (subst (cons 1 newtxt) (cons 1 oldtxt) dimn))
            (entmod dimn)
            (setq cnt (1+ cnt))
         ) ;_ 結束progn
      ) ;_ 結束if
      (setq i (1+ i))                                       ;search the next dimension.
   ) ;_ 結束while
   (princ (strcat "\n*** Just " (itoa cnt) " dimensions modified! ***"))
   ;;if the scale is 1:1,not to scale it.
   (if (/= sc "")
      (if (> (atoi sc) 1)
         (progn (setq scpnt (getpoint "\nInput the scale center point:"))
                (command "._scale" ent "" scpnt (atof sc))
                (setq scstr (strcat "SCALE " sc ":1") ;_ if it's 1:1(no input),not to display it
                      scstr (strcase scstr)
                ) ;_ 結束setq
         ) ;_ 結束progn
      ) ;_ 結束if
   ) ;_ 結束IF
   (if (or systr scstr numstr)
      (progn
         (setq txtpnt (getpoint "\nWhere to place the note?"))
         (setq oldlay (getvar "clayer"))
         (if (tblsearch "layer" "mark")
            (setvar "clayer" "mark")
         ) ;_ 結束IF
         (command "._text" "s" "standard" "j" "mc" txtpnt (* 2.5 (getvar "dimscale")) "0" systr "")
         (if scstr
            (command "._text" "" scstr)
         ) ;_ 結束if
         (if numstr
            (command "._text" "" numstr)
         ) ;_ 結束if
                                                            ;(command)
         (setvar "clayer" oldlay)
      ) ;_ 結束PROGN
   ) ;_ 結束IF
   (setvar "cmdecho" 1)
   (grtext)
   (princ)
) ;_ 結束defun
;;;---------SUBPROGRAMM---------------
;;;This pro. is to make the linear dimension's measurement.
(defun c42 (ent / p1x p1y p2x p2y dy v ang dimtyp dx p1 p2 dimtyp)
   (setq dimtyp (cdr (assoc 70 ent))
         dimtyp (logand dimtyp 7)
   ) ;_ 結束setq
   (cond
      ;;aligned&rotateddimension
      ((= dimtyp 0)
       (progn
          (setq p1  (assoc 13 ent)
                p2  (assoc 14 ent)
                p1x (nth 1 p1)
                p1y (nth 2 p1)
                p2x (nth 1 p2)
                p2y (nth 2 p2)
                dx  (abs (- p1x p2x))
                dy  (abs (- p1y p2y))
                ang (cdr (assoc 50 ent))
          ) ;_ 結束setq
          (if (= ang 0)
             (setq v dx)
             (setq v dy)
          ) ;_ 結束if
       ) ;_ 結束progn
      ) ;_case 1
      ;;aligneddimension
      ((= dimtyp 1)
       (setq p1 (assoc 13 ent)
             p2 (assoc 14 ent)
             v  (distance (cdr p1) (cdr p2))
       ) ;_ 結束setq
      ) ;_case 2
      ;;radialdimension & diametricdimension
      ((or (= dimtyp 4) (= dimtyp 3))
       (setq p1 (assoc 10 ent)
             p2 (assoc 15 ent)
             v  (distance (cdr p1) (cdr p2))                ;取得數值v作為函數值.           
       ) ;_ 結束setq
      ) ;_case 3
   ) ;_ 結束cond
) ;_ 結束defun

;;;;-SUBROTINE 2------
;;;This pro. is to substitute a new string for the old string in the source string.
(defun subst_str (newstr oldstr str / i k k1 k2 n tmpstr stre strf)
   (setq k1 (strlen str)
         k2 (strlen oldstr)
         k  (1+ (- k1 k2))
         i  1
         n  nil
   ) ;_ 結束setq
   (while (<= i k)
      (setq tmpstr (substr str i k2))
      (if (= tmpstr oldstr)
         (progn
            (setq n i
                  i (1+ k)
            )                                               ;set the loop-off condition to end the loop
         ) ;_ 結束progn
         (setq i (1+ i))
      ) ;_ 結束if
   ) ;_ 結束while
   (setq k1   (1- n)
         k2   (+ k2 n)
         strf (substr str 1 k1)
         stre (substr str k2)
   ) ;_ 結束setq
   (setq str (strcat strf newstr stre))
) ;_ 結束defun
;;;~~~~~~~~~~end of CCS~~~~~~~~~~~~

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

本版积分规则

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

GMT+8, 2024-11-25 11:48 , Processed in 0.212336 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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