明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1794|回复: 1

相信大家有这样的需要

[复制链接]
发表于 2003-3-23 18:03:00 | 显示全部楼层 |阅读模式
有这样的软件吗?
1。area只能一个一个算面积,有小工具框选算总面积吗?
2。有一些东西被重复插入了两次,不幸的是都被炸开了,需要删除一个(即完全相同的物体有两个),好像以前我看到过有个插件可以删除重合的线条的……
发表于 2003-3-24 08:43:00 | 显示全部楼层

2.删除重合,只對完全相同的物体有效

;| Programmed by Dave Aguilar
   DUPREM.LSP  1994 Onyx Software

This program creates an list of entity lists for all entities in the
drawing (using the first VERTEX for POLYLINES) and then compares each
entity list with the total list, building a new selection set of all
duplicate entries which are then erased.

it's not guarenteed but try it on a copy of a badly duplicated drawing
and see if it helps.

------------------------------------------------------------------------
------------------------------------------------------------------------
Modified by J. Tippit, SPAUG President                                08/25/99
    E-mail:                     cadpres@spaug.org
    Web Site:                http://www.spaug.org

        1. Modified to work with R14 & 2000
        2. Now prompts for 3 types of selection sets
        3. Works on all types of entities (including LWPOLYLINES)

Large donations to SPAUG is appreciated. :)
------------------------------------------------------------------------
------------------------------------------------------------------------

|;

(defun C:DUPREM        ()
  (setvar "cmdecho" 0)
  (setq        F1 NIL
        F1 0
  )
  ;; Added by Jeff Tippit 08/25/99
  ;; Start
  (initget "S L A")
  (setq        SLE
         (getkword
           "\nSelect objects by <S>election set, <L>imits, or <A>ll: "
         )
  )
  (cond
    ((= SLE "S") (setq SA (ssget)))
    ((= SLE "L")
     (setq SA (ssget "c" (getvar "extmin") (getvar "extmax")))
    )
    ((= SLE "A")
     (setq SA (ssget "X" (list (cons 410 (getvar "CTAB")))))
    )
  )
  ;; End
  (setq        CA 0
        TA (sslength SA)
        LA NIL
        LB NIL
  )
  (while (< CA TA)
    (setq ENTA (ssname SA CA)
          EA   (cdr (entget ENTA))
          TYPA (cdr (assoc 0 EA))
    )
    ;;      (if (= typa "OLYLINE") (progn
    ;;         (setq entb (entnext enta) ea (cdr (entget entb)))
    ;;      ))

    ;; Added by Jeff Tippit 08/25/99
    ;; Updated for R14 & 2000
    ;; Start
    (setq A1 (assoc 5 EA))
    (setq A2 (cons 5 ""))
    (setq EA (subst A2 A1 EA))
    (if        (wcmatch (getvar "ACADVER") "*15*")
      (progn
        (setq A3 (assoc 330 EA))
        (setq A4 (cons 330 ""))
        (setq EA (subst A4 A3 EA))
      )
    )
    (if        (= TYPA "VIEWPORT")
      (progn
        (setq A3 (assoc 69 EA))
        (setq A4 (cons 69 ""))
        (setq EA (subst A4 A3 EA))
        (setq A3 (assoc 68 EA))
        (setq A4 (cons 68 ""))
        (setq EA (subst A4 A3 EA))
      )
    )
    ;; End
    (setq LA (cons ENTA LA)
          LB (cons EA LB)
          CA (+ CA 1)
    )
  )
  (setq        SC    NIL
        SC    (ssadd)
        LTEST LB
  )
  (setq CA 0)
  (setq        TES   (car LTEST)
        LTEST (cdr LTEST)
        TA    NIL
        TA    (length LTEST)
  )
  (while (/= TA 0)
    (if        (member TES LTEST)
      (progn
        (setq SC (ssadd (nth CA LA) SC))
        ;;(prompt "\nFound aduplicate entity.")
        (setq F1 (+ F1 1))
      )
    )
    (setq CA (+ CA 1))
    (setq TES        (car LTEST)
          LTEST        (cdr LTEST)
          TA        (length LTEST)
    )
  )
  (command "_.erase" SC "")
  (redraw)
  (prompt "\n")
  (prin1 F1)
  (prompt " duplicate entities erased.")
  (princ)
)

(prompt
  "\nType DUPREM to run. Delete duplicate entity routine Ver 2.0 loaded."
)
(princ)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-26 19:31 , Processed in 0.166271 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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