乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 59|回复: 14

[编程交流] 在端点处自动插入块

[复制链接]

13

主题

61

帖子

48

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 07:37:44 | 显示全部楼层 |阅读模式
我第一次看到这个Lisp程序的地方就很喜欢。它允许您在选定对象的所有端点插入指定块。这将是可怕的用于插入基脚后尺寸。。我们发现,对于我们的美国来说,在规定的距离上划线,然后快速标注尺寸效果很好。我们只需要在标注尺寸之前添加这个lisp,我们就可以自动放置我们的基脚了!我唯一搞不清楚的问题是如何以1:1的比例导入块,而不是以dim-scale/txt高度为基础。谢谢托马斯让我发布这个!
 
 
  1. ;;; ENDTICK.LSP
  2. ;;;
  3. ;;; Copyright 2006 Thomas Gail Haws
  4. ;;; This program is free software under the terms of the
  5. ;;; GNU (GNU--acronym for Gnu's Not Unix--sounds like canoe)
  6. ;;; General Public License as published by the Free Software Foundation,
  7. ;;; version 2 of the License.
  8. ;;;
  9. ;;; You can redistribute this software for any fee or no fee and/or
  10. ;;; modify it in any way, but it and ANY MODIFICATIONS OR DERIVATIONS
  11. ;;; continue to be governed by the license, which protects the perpetual
  12. ;;; availability of the software for free distribution and modification.
  13. ;;;
  14. ;;; You CAN'T put this code into any proprietary package.  Read the license.
  15. ;;;
  16. ;;; If you improve this software, please make a revision submittal to the
  17. ;;; copyright owner at [url="http://www.hawsedc.com/"]www.hawsedc.com[/url].
  18. ;;;
  19. ;;; This program is distributed in the hope that it will be useful,
  20. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ;;; GNU General Public License on the World Wide Web for more details.
  23. ;;;
  24. ;;; DESCRIPTION
  25. ;;;
  26. ;;; ENDTICK inserts and aligns the ENDTICK block at the endpoint of every arc or line
  27. ;;; in a selection set.  It removes duplicate ticks.
  28. ;;;
  29. ;;; ENDTICK is useful for surveying and civil engineering plans to demarcate points of
  30. ;;; curvature, tangency, et cetera.
  31. ;;;
  32. ;;; You can make your own ENDTICK block if you prefer some custom shape or size tick.
  33. ;;; The default ENDTICK block is a one unit long vertical line with its insertion point
  34. ;;; at its midpoint.  ENDTICK scales the ticks to the dimension text height
  35. ;;; (dimscale * dimtext), so the default ENDTICK block will look as big as the current
  36. ;;; dimension text height.
  37. ;;;
  38. ;;; Revisions
  39. ;;; 20060914  TGH   Version 1.0PR released.  3 hrs.  Works only with world UCS and View
  40. (defun c:ENDTICK () (ENDTICK))
  41. (defun
  42.   ENDTICK
  43.       ;;No global variables.  All the variables should be listed here as local.
  44.       (/        CENPOINT    DS        DT        ENDANG
  45.        ENDPOINT    ENTLIST        ENTNAME    ENTTYPE        I
  46.        MINTICKSEPARATION        RADIUS    SS1        STARTANG
  47.        STARTPOINT    TICKLIST    TS
  48.       )
  49. ;;Set initial variables
  50. (setq
  51.    ds (getvar "dimscale")
  52.    dt (getvar "dimtxt")
  53.    ts (* ds dt)
  54.    ;;If endpoints are closer together than the distance given below
  55.    ;; and also aligned angularly closer than the angular difference below,
  56.    ;; ENDTICK only plots the first one of them it finds.
  57.    mintickseparation
  58.     (* ts 0.01)
  59.    ;;In radians.  Setting to some big number like 10 (larger than 2 pi) will remove coincident ticks even with different rotations.
  60.    mintickangulardif
  61.     0.01
  62. )
  63. ;;Get selection set from user.  Limit to lines and arcs.
  64. (setq
  65.    ss1    (ssget '((0 . "LINE,ARC")))
  66.    i    -1
  67. )
  68. ;;Get endpoints and orientations from selection set
  69. (while (setq entname (ssname ss1 (setq i (1+ i))))
  70.    (setq
  71.      entlist
  72.       (entget entname)
  73.      enttype
  74.       (cdr (assoc 0 entlist))
  75.    )
  76.    (cond
  77.      ((= enttype "LINE")
  78.       (setq
  79.     startpoint
  80.      (cdr (assoc 10 entlist))
  81.     endpoint
  82.      (cdr (assoc 11 entlist))
  83.     ticklist
  84.      (ENDTICK-addtolist
  85.        (list startpoint (angle startpoint endpoint))
  86.        ticklist
  87.        mintickseparation
  88.        mintickangulardif
  89.      )
  90.     ticklist
  91.      (ENDTICK-addtolist
  92.        (list
  93.          endpoint
  94.          (angle endpoint startpoint)
  95.        )
  96.        ticklist
  97.        mintickseparation
  98.        mintickangulardif
  99.      )
  100.       )
  101.      )
  102.      ((= enttype "ARC")
  103.       (setq
  104.     cenpoint
  105.      (cdr (assoc 10 entlist))
  106.     radius
  107.      (cdr (assoc 40 entlist))
  108.     startang
  109.      (cdr (assoc 50 entlist))
  110.     endang
  111.      (cdr (assoc 51 entlist))
  112.     startpoint
  113.      (polar cenpoint startang radius)
  114.     endpoint
  115.      (polar cenpoint endang radius)
  116.     ticklist
  117.      (ENDTICK-addtolist
  118.        (list startpoint (+ startang (/ pi 2)))
  119.        ticklist
  120.        mintickseparation
  121.        mintickangulardif
  122.      )
  123.     ticklist
  124.      (ENDTICK-addtolist
  125.        (list endpoint (+ endang (/ pi 2)))
  126.        ticklist
  127.        mintickseparation
  128.        mintickangulardif
  129.      )
  130.       )
  131.      )
  132.    )
  133. )
  134. (setq auold (getvar "aunits"))
  135. (setvar "aunits" 3)
  136. (foreach
  137.     tick ticklist
  138.    (command "._insert" "endtick" (car tick) ts "" (cadr tick))
  139. )
  140. (setvar "aunits" auold)
  141. )
  142. (defun
  143.   ENDTICK-addtolist
  144.             (tick          ticklist          mintickseparation
  145.              mintickangulardif              /
  146.              dupfound          templist          tickcheck
  147.             )
  148. ;;Look for duplicates in list
  149. (setq templist ticklist)
  150. (while (setq tickcheck (car templist))
  151.    (if    (and
  152.      (< (distance (car tick) (car tickcheck)) mintickseparation)
  153.      (< (abs (- (cadr tick) (cadr tickcheck))) mintickangulardif)
  154.    )
  155.      (setq
  156.    dupfound
  157.     T
  158.    templist
  159.     nil
  160.      )
  161.      (setq templist (cdr templist))
  162.    )
  163. )
  164. (if (not dupfound)
  165.    (cons tick ticklist)
  166.    ticklist
  167. )
  168. )
回复

使用道具 举报

13

主题

61

帖子

48

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 07:42:10 | 显示全部楼层
用于导入的块
endtick。图纸
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:49:06 | 显示全部楼层
代码格式:
 
http://www.cadtutor.net/forum/showthread.php?9184-代码发布指南
回复

使用道具 举报

13

主题

61

帖子

48

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 07:52:01 | 显示全部楼层
谢谢需要最后提醒。。。
 
  1. ;;; ENDTICK.LSP
  2. ;;;
  3. ;;; Copyright 2006 Thomas Gail Haws
  4. ;;; This program is free software under the terms of the
  5. ;;; GNU (GNU--acronym for Gnu's Not Unix--sounds like canoe)
  6. ;;; General Public License as published by the Free Software Foundation,
  7. ;;; version 2 of the License.
  8. ;;;
  9. ;;; You can redistribute this software for any fee or no fee and/or
  10. ;;; modify it in any way, but it and ANY MODIFICATIONS OR DERIVATIONS
  11. ;;; continue to be governed by the license, which protects the perpetual
  12. ;;; availability of the software for free distribution and modification.
  13. ;;;
  14. ;;; You CAN'T put this code into any proprietary package.  Read the license.
  15. ;;;
  16. ;;; If you improve this software, please make a revision submittal to the
  17. ;;; copyright owner at www.hawsedc.com.
  18. ;;;
  19. ;;; This program is distributed in the hope that it will be useful,
  20. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ;;; GNU General Public License on the World Wide Web for more details.
  23. ;;;
  24. ;;; DESCRIPTION
  25. ;;;
  26. ;;; ENDTICK inserts and aligns the ENDTICK block at the endpoint of every arc or line
  27. ;;; in a selection set.  It removes duplicate ticks.
  28. ;;;
  29. ;;; ENDTICK is useful for surveying and civil engineering plans to demarcate points of
  30. ;;; curvature, tangency, et cetera.
  31. ;;;
  32. ;;; You can make your own ENDTICK block if you prefer some custom shape or size tick.
  33. ;;; The default ENDTICK block is a one unit long vertical line with its insertion point
  34. ;;; at its midpoint.  ENDTICK scales the ticks to the dimension text height
  35. ;;; (dimscale * dimtext), so the default ENDTICK block will look as big as the current
  36. ;;; dimension text height.
  37. ;;;
  38. ;;; Revisions
  39. ;;; 20060914  TGH   Version 1.0PR released.  3 hrs.  Works only with world UCS and View
  40. (defun c:ENDTICK () (ENDTICK))
  41. (defun
  42.   ENDTICK
  43.       ;;No global variables.  All the variables should be listed here as local.
  44.       (/        CENPOINT    DS        DT        ENDANG
  45.        ENDPOINT    ENTLIST        ENTNAME    ENTTYPE        I
  46.        MINTICKSEPARATION        RADIUS    SS1        STARTANG
  47.        STARTPOINT    TICKLIST    TS
  48.       )
  49. ;;Set initial variables
  50. (setq
  51.    ds (getvar "dimscale")
  52.    dt (getvar "dimtxt")
  53.    ts (* ds dt)
  54.    ;;If endpoints are closer together than the distance given below
  55.    ;; and also aligned angularly closer than the angular difference below,
  56.    ;; ENDTICK only plots the first one of them it finds.
  57.    mintickseparation
  58.     (* ts 0.01)
  59.    ;;In radians.  Setting to some big number like 10 (larger than 2 pi) will remove coincident ticks even with different rotations.
  60.    mintickangulardif
  61.     0.01
  62. )
  63. ;;Get selection set from user.  Limit to lines and arcs.
  64. (setq
  65.    ss1    (ssget '((0 . "LINE,ARC")))
  66.    i    -1
  67. )
  68. ;;Get endpoints and orientations from selection set
  69. (while (setq entname (ssname ss1 (setq i (1+ i))))
  70.    (setq
  71.      entlist
  72.       (entget entname)
  73.      enttype
  74.       (cdr (assoc 0 entlist))
  75.    )
  76.    (cond
  77.      ((= enttype "LINE")
  78.       (setq
  79.     startpoint
  80.      (cdr (assoc 10 entlist))
  81.     endpoint
  82.      (cdr (assoc 11 entlist))
  83.     ticklist
  84.      (ENDTICK-addtolist
  85.        (list startpoint (angle startpoint endpoint))
  86.        ticklist
  87.        mintickseparation
  88.        mintickangulardif
  89.      )
  90.     ticklist
  91.      (ENDTICK-addtolist
  92.        (list
  93.          endpoint
  94.          (angle endpoint startpoint)
  95.        )
  96.        ticklist
  97.        mintickseparation
  98.        mintickangulardif
  99.      )
  100.       )
  101.      )
  102.      ((= enttype "ARC")
  103.       (setq
  104.     cenpoint
  105.      (cdr (assoc 10 entlist))
  106.     radius
  107.      (cdr (assoc 40 entlist))
  108.     startang
  109.      (cdr (assoc 50 entlist))
  110.     endang
  111.      (cdr (assoc 51 entlist))
  112.     startpoint
  113.      (polar cenpoint startang radius)
  114.     endpoint
  115.      (polar cenpoint endang radius)
  116.     ticklist
  117.      (ENDTICK-addtolist
  118.        (list startpoint (+ startang (/ pi 2)))
  119.        ticklist
  120.        mintickseparation
  121.        mintickangulardif
  122.      )
  123.     ticklist
  124.      (ENDTICK-addtolist
  125.        (list endpoint (+ endang (/ pi 2)))
  126.        ticklist
  127.        mintickseparation
  128.        mintickangulardif
  129.      )
  130.       )
  131.      )
  132.    )
  133. )
  134. (setq auold (getvar "aunits"))
  135. (setvar "aunits" 3)
  136. (foreach
  137.     tick ticklist
  138.    (command "._insert" "endtick" (car tick) ts "" (cadr tick))
  139. )
  140. (setvar "aunits" auold)
  141. )
  142. (defun
  143.   ENDTICK-addtolist
  144.             (tick          ticklist          mintickseparation
  145.              mintickangulardif              /
  146.              dupfound          templist          tickcheck
  147.             )
  148. ;;Look for duplicates in list
  149. (setq templist ticklist)
  150. (while (setq tickcheck (car templist))
  151.    (if    (and
  152.      (< (distance (car tick) (car tickcheck)) mintickseparation)
  153.      (< (abs (- (cadr tick) (cadr tickcheck))) mintickangulardif)
  154.    )
  155.      (setq
  156.    dupfound
  157.     T
  158.    templist
  159.     nil
  160.      )
  161.      (setq templist (cdr templist))
  162.    )
  163. )
  164. (if (not dupfound)
  165.    (cons tick ticklist)
  166.    ticklist
  167. )
  168. )
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 07:57:03 | 显示全部楼层
很快就被砍掉了。。。
 
  1. ;;---------------------=={ EndBlock }==-----------------------;;
  2. ;;                                                            ;;
  3. ;;  Inserts a Block at the end points of selected objects     ;;
  4. ;;------------------------------------------------------------;;
  5. ;;  Author: Lee McDonnell, 2010                               ;;
  6. ;;                                                            ;;
  7. ;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
  8. ;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
  9. ;;------------------------------------------------------------;;
  10. (defun c:EndBlock ( / *error* _StartUndo _EndUndo _Insert _AngleAtParam doc spc block ss )
  11. (vl-load-com)
  12. ;; © Lee Mac 2010
  13. (setq block "endtick.dwg") ;; << Block Name
  14. (defun *error* ( msg )
  15.    (and doc (_EndUndo doc))
  16.    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
  17.        (princ (strcat "\n** Error: " msg " **")))
  18.    (princ)
  19. )
  20. (defun _StartUndo ( doc ) (_EndUndo doc)
  21.    (vla-StartUndoMark doc)
  22. )
  23. (defun _EndUndo ( doc )
  24.    (if (= 8 (logand 8 (getvar 'UNDOCTL)))
  25.      (vla-EndUndoMark doc)
  26.    )
  27. )
  28. (defun _Insert ( space block point scale rotation )
  29.    (if
  30.      (not
  31.        (vl-catch-all-error-p
  32.          (setq result
  33.            (vl-catch-all-apply 'vla-insertblock
  34.              (list space (vlax-3D-point point) block scale scale scale rotation)
  35.            )
  36.          )
  37.        )
  38.      )
  39.      result
  40.    )
  41. )
  42. (defun _AngleatParam ( entity param )
  43.    (angle '(0. 0. 0.) (vlax-curve-getFirstDeriv entity param))
  44. )      
  45. (LM:ActiveSpace 'doc 'spc)
  46. (cond
  47.    ( (= 4 (logand 4 (cdr (assoc 70 (tblsearch "LAYER" (getvar 'CLAYER))))))
  48.      (princ "\n** Current Layer Locked **")
  49.    )
  50.    ( (not
  51.        (or (tblsearch "BLOCK" block)
  52.          (setq block
  53.            (findfile
  54.              (strcat block
  55.                (if (eq "" (vl-filename-extension block)) ".dwg" "")
  56.              )
  57.            )
  58.          )
  59.        )
  60.      )
  61.      (princ "\n** Block not Found **")
  62.    )
  63.    ( (not (setq ss (ssget '((0 . "ARC,CIRCLE,ELLIPSE,SPLINE,LINE,LWPOLYLINE,")))))
  64.      (princ "\n*Cancel*")
  65.    )
  66.    (t
  67.      (_StartUndo doc)
  68.    
  69.      (
  70.        (lambda ( i / e )
  71.          (while (setq e (ssname ss (setq i (1+ i))))
  72.            (mapcar
  73.              (function
  74.                (lambda ( point rotation )
  75.                  (_Insert spc block point 1.0 rotation)
  76.                )
  77.              )
  78.              (if (vlax-curve-isClosed e)
  79.                (list (vlax-curve-getStartPoint e))
  80.                (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e))
  81.              )
  82.              (mapcar
  83.                (function
  84.                  (lambda ( param ) (_AngleAtParam e param))
  85.                )
  86.                (if (vlax-curve-isClosed e)
  87.                  (list (+ (vlax-curve-getStartParam e) 1e-4))
  88.                  (list (+ (vlax-curve-getStartParam e) 1e-4) (- (vlax-curve-getEndParam e) 1e-4))
  89.                )
  90.              )
  91.            )
  92.          )
  93.        )
  94.        -1
  95.      )
  96.      (_EndUndo doc)
  97.    )
  98. )
  99. (princ)
  100. )            
  101. ;;--------------------=={ ActiveSpace }==---------------------;;
  102. ;;                                                            ;;
  103. ;;  Retrieves pointers to the Active Document and Space       ;;
  104. ;;------------------------------------------------------------;;
  105. ;;  Author: Lee McDonnell, 2010                               ;;
  106. ;;                                                            ;;
  107. ;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
  108. ;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
  109. ;;------------------------------------------------------------;;
  110. ;;  Arguments:                                                ;;
  111. ;;  *doc - quoted symbol other than *doc                      ;;
  112. ;;  *spc - quoted symbol other than *spc                      ;;
  113. ;;------------------------------------------------------------;;
  114. (defun LM:ActiveSpace ( *doc *spc )
  115. ;; © Lee Mac 2010
  116. (set *spc
  117.    (if
  118.      (or
  119.        (eq AcModelSpace
  120.          (vla-get-ActiveSpace
  121.            (set *doc
  122.              (vla-get-ActiveDocument
  123.                (vlax-get-acad-object)
  124.              )
  125.            )
  126.          )
  127.        )
  128.        (eq :vlax-true (vla-get-MSpace (eval *doc)))
  129.      )
  130.      (vla-get-ModelSpace (eval *doc))
  131.      (vla-get-PaperSpace (eval *doc))
  132.    )
  133. )
  134. )

 
在第二个代码中,添加以下内容:
 
  1. ;;---------------------=={ EndBlock }==-----------------------;;
  2. ;;                                                            ;;
  3. ;;  Inserts a Block at the end points of selected objects     ;;
  4. ;;------------------------------------------------------------;;
  5. ;;  Author: Lee McDonnell, 2010                               ;;
  6. ;;                                                            ;;
  7. ;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
  8. ;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
  9. ;;------------------------------------------------------------;;
  10. (defun c:EndBlock ( / *error* _StartUndo _EndUndo _Insert _AngleAtParam doc block ss )
  11. (vl-load-com)
  12. ;; © Lee Mac 2010
  13. (setq block "endtick.dwg") ;; << Block Name
  14. (defun *error* ( msg )
  15.    (and doc (_EndUndo doc))
  16.    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
  17.        (princ (strcat "\n** Error: " msg " **")))
  18.    (princ)
  19. )
  20. (defun _StartUndo ( doc ) (_EndUndo doc)
  21.    (vla-StartUndoMark doc)
  22. )
  23. (defun _EndUndo ( doc )
  24.    (if (= 8 (logand 8 (getvar 'UNDOCTL)))
  25.      (vla-EndUndoMark doc)
  26.    )
  27. )
  28. (defun _Insert ( block point rotation )
  29.    (entmakex
  30.      (list
  31.        (cons 0 "INSERT")
  32.        (cons 2  block)
  33.        (cons 10 point)
  34.        (cons 50 rotation)
  35.      )
  36.    )
  37. )
  38. (defun _AngleatParam ( entity param )
  39.    (angle '(0. 0. 0.) (vlax-curve-getFirstDeriv entity param))
  40. )      
  41. (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
  42. (cond
  43.    ( (= 4 (logand 4 (cdr (assoc 70 (tblsearch "LAYER" (getvar 'CLAYER))))))
  44.      (princ "\n** Current Layer Locked **")
  45.    )
  46.    ( (not
  47.        (or
  48.          (and (tblsearch "BLOCK" (vl-filename-base block))
  49.            (setq block (vl-filename-base block))
  50.          )
  51.          (and
  52.            (setq block
  53.              (findfile
  54.                (strcat block
  55.                  (if (eq "" (vl-filename-extension block)) ".dwg" "")
  56.                )
  57.              )
  58.            )
  59.            (
  60.              (lambda ( / ocm )
  61.                (setq ocm (getvar 'CMDECHO)) (setvar 'CMDECHO 0)
  62.                (command "_.-insert" block) (command)
  63.                (setvar 'CMDECHO ocm)
  64.                
  65.                (tblsearch "BLOCK" (setq block (vl-filename-base block)))
  66.              )
  67.            )
  68.          )
  69.        )
  70.      )
  71.      (princ "\n** Block not Found **")
  72.    )
  73.    ( (not (setq ss (ssget '((0 . "ARC,CIRCLE,ELLIPSE,SPLINE,LINE,LWPOLYLINE,")))))
  74.      (princ "\n*Cancel*")
  75.    )
  76.    (t
  77.      (_StartUndo doc)
  78.    
  79.      (
  80.        (lambda ( i / e )
  81.          (while (setq e (ssname ss (setq i (1+ i))))
  82.            (mapcar
  83.              (function
  84.                (lambda ( point rotation ) (_Insert block point rotation))
  85.              )
  86.              (if (vlax-curve-isClosed e)
  87.                (list (vlax-curve-getStartPoint e))
  88.                (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e))
  89.              )
  90.              (mapcar
  91.                (function
  92.                  (lambda ( param ) (_AngleAtParam e param))
  93.                )
  94.                (if (vlax-curve-isClosed e)
  95.                  (list (+ (vlax-curve-getStartParam e) 1e-4))
  96.                  (list (+ (vlax-curve-getStartParam e) 1e-4) (- (vlax-curve-getEndParam e) 1e-4))
  97.                )
  98.              )
  99.            )
  100.          )
  101.        )
  102.        -1
  103.      )
  104.      (_EndUndo doc)
  105.    )
  106. )
  107. (princ)
  108. )            
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:00:34 | 显示全部楼层
李,谢谢你的辅导!
史蒂夫
回复

使用道具 举报

13

主题

61

帖子

48

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 08:06:23 | 显示全部楼层
不客气,史蒂夫,随时欢迎。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:09:52 | 显示全部楼层
我受够了这个Lisp程序!只是好奇。正如代码所示。。它只将块导入端点,而不将块添加到PLINE内直线的端点。。是否可以将块导入到选定多条线组内的点?。。甚至更多,仅仅是这些点,而不包括端点?我的第一个业余举动是在片段中加入普林
  1. (_Insert spc block point [color=red][b]1.0[/b][/color] rotation)

这并没有做到,我在下面使用节点插入时遇到了类似的代码,但想到所有的捕捉设置,我不知道这样的事情是怎么可能的。。有什么建议吗?
 
 
很抱歉,我找不到作者对此给予赞扬。。
  1.   (defun _Insert ( block point rotation )
  2.    (entmakex
  3.      (list
  4.        (cons 0 "INSERT")
  5.        (cons 2  block)
  6.        (cons 10 point)
  7.        (cons 50 rotation)
  8. [color=red][b]        (cons 41 1.0) ;; X Scale
  9.        (cons 42 1.0) ;; Y Scale
  10.        (cons 43 1.0) ;; Z Scale[/b][/color]
  11.      )
  12.    )
  13. )

这是李的优秀作品,我正在使用从第1页的帖子。。。
  1. ( (not (setq ss (ssget '((0 . "ARC,CIRCLE,ELLIPSE,SPLINE,PLINE,LINE,LWPOLYLINE,")))))
回复

使用道具 举报

6

主题

249

帖子

247

银币

初来乍到

Rank: 1

铜币
30
发表于 2022-7-6 08:15:59 | 显示全部楼层
此lisp不适用于区域
你能修改一下以处理地区问题吗
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:19:25 | 显示全部楼层
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-10 05:03 , Processed in 0.494567 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表