乐筑天下

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

[编程交流] 正位于ano顶部的多段线

[复制链接]

57

主题

183

帖子

126

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
285
发表于 2022-7-6 06:58:50 | 显示全部楼层 |阅读模式
在我的DWG文件中存在(多段线正好位于另一条多段线的顶部)。
 
我需要找到包含多段线副本的多段线,
 
这是一条多段线被复制并粘贴在同一条多段线上
 
 
有什么帮助吗?
回复

使用道具 举报

1

主题

475

帖子

481

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 07:19:17 | 显示全部楼层
命令:Overkill
 
亨里克
回复

使用道具 举报

57

主题

183

帖子

126

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
285
发表于 2022-7-6 07:34:05 | 显示全部楼层
我需要向系统操作员展示一条重叠的多段线,即它的相同副本。
 
!!!!复制并粘贴多段线时,她将在原始多段线上进行检查
 
 
他接到复制和粘贴的命令,有时忘记了操作员
留下了两条折线,一条在另一条上,必须警告他。
回复

使用道具 举报

10

主题

8258

帖子

8335

银币

初来乍到

Rank: 1

铜币
31
发表于 2022-7-6 07:43:40 | 显示全部楼层
使用下面链接中提供的lisp例程查找重复实体。
 
http://autolispindia.blogspot.com/2012/10/find-duplicate-entities-obects-in.html
回复

使用道具 举报

57

主题

183

帖子

126

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
285
发表于 2022-7-6 07:53:22 | 显示全部楼层
我的互联网屏蔽了这个网站(博客),你可以复制代码吗?
回复

使用道具 举报

24

主题

135

帖子

111

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-6 08:10:07 | 显示全部楼层
 
  1. ;start copy form here
  2. ; Loads Visual LISP extensions to AutoLISP
  3. (vl-load-com)
  4. ;; this will cll the fiu
  5. (defun C:Dup()
  6. (duplicateentities)
  7. )
  8. ;this is the main function to find duplicate entities/Objects in Autocad
  9. ;this is very fast method
  10. ;this will catch duplicate entities like Blocks,Point,Line only
  11. ;this will not apply for polyline,Lwpolyline
  12. (defun duplicateentities (/ $acad $adoc $mspa ent objname ins bname stp enp lay errcnt)
  13. (setq    $acad (vlax-get-acad-object)
  14.    $adoc (vla-get-activedocument $acad)
  15.    $mspa (vlax-get-property $adoc 'modelspace)
  16.    errcnt 0
  17. ) ;_ end of setq
  18. (vlax-for obj    $mspa
  19.    (setq ent      (vlax-vla-object->ename obj)
  20.      objname (vlax-get-property obj 'objectname)
  21.    ) ;_ end of setq
  22.    (cond
  23.      ((eq objname "AcDbBlockReference")
  24.       (setq ins   (vlax-get obj 'insertionpoint)
  25.         bname (vlax-get obj 'name)
  26.       ) ;_ end of setq
  27.       (if (> (sslength (ssget "x" (list (cons 2 bname) (cons 10 ins)))) 1)
  28.     (progn
  29.       (markerror ent (strcat "Duplicate objects found [" bname "]") nil)
  30.       (setq errcnt (1+ errcnt))
  31.     ) ;_ end of progn
  32.       ) ;_ end of if
  33.      )
  34.      ((eq objname "AcDbPoint")
  35.       (setq ins (vlax-get obj 'Coordinates))
  36.         lay (vlax-get obj 'layer)
  37.       (if (> (sslength (ssget "x" (list (cons 0 "POINT") (cons 10 ins)))) 1)
  38.     (progn
  39.       (markerror ent (strcat "Duplicate objects found [" lay "]") nil)
  40.       (setq errcnt (1+ errcnt))
  41.     ) ;_ end of progn
  42.       ) ;_ end of if
  43.      )
  44.      ((eq objname "AcDbLine")
  45.       (setq stp (vlax-get obj 'startpoint)
  46.         enp (vlax-get obj 'endpoint)
  47.         lay (vlax-get obj 'layer)
  48.       ) ;_ end of setq
  49.       (if (> (sslength (ssget "x" (list (cons 10 stp) (cons 11 enp)))) 1)
  50.     (progn
  51.       (markerror ent (strcat "Duplicate objects found [" lay "]") nil)
  52.       (setq errcnt (1+ errcnt))
  53.     ) ;_ end of progn
  54.       ) ;_ end of if
  55.      )
  56.    ) ;_ end of cond
  57. ) ;_ end of VLAX-FOR
  58. ) ;_ end of defun
  59. ;it will mark error (place circle in error layer) in model
  60. (defun markerror (e er f / el etyp handle ip)
  61. (setq    el     (entget e)
  62.    etyp   (strcase (cdr (assoc 0 el)))
  63.    handle (cdr (assoc 5 el))
  64.    ip     (cond
  65.         ((wcmatch etyp "*LINE")
  66.          (vlax-get-midpoint e)
  67.         )
  68.         (t
  69.          (cdr (assoc 10 el))
  70.         )
  71.           ) ;_ end of cond
  72. ) ;_ end of setq
  73. (entmake
  74.    (list (cons 0 "circle") (cons 8 "Error") (cons 10 ip) (cons 62 2) (cons 40 15))
  75. ) ;_ end of entmake
  76. (if f
  77.    (write-line (strcat er " For object " handle) f)
  78. ) ;_ end of if
  79. ) ;_ end of defun
  80. ;this function will get mid point for LINE,POLYLINE,LWPOLYLINE
  81. (defun vlax-get-midpoint (e / ve)
  82. (setq ve (vlax-ename->vla-object e))
  83. (if (= (vlax-curve-getendparam ve) 0)
  84.    (vlax-curve-getstartpoint ve)
  85.    (vlax-curve-getpointatdist
  86.      ve
  87.      (/ (vlax-curve-getdistatparam ve (vlax-curve-getendparam ve)) 2)
  88.    )
  89. )
  90. ) ;_ end of defun

 
Kullaireddy Tadipatri发布的lisp代码
 
HTH公司
Espero ter ajudado。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 11:00 , Processed in 0.694439 second(s), 74 queries .

© 2020-2025 乐筑天下

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