明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1130|回复: 4

[提问] 怎么实现框选将区域覆盖后置!

  [复制链接]
发表于 2015-3-23 21:54 | 显示全部楼层 |阅读模式
怎么实现框选将区域覆盖后置!
 楼主| 发表于 2015-3-31 17:02 | 显示全部楼层
谁帮忙改改以下是填充后置(帮忙改成区域覆盖后置)
;;;===============================================================================================================================================
;;;填充后置
;;;===============================================================================================================================================
;;一键所有填充对象置后显示,CAD2005以上版本适用 By Gu_xl 2014.07.17
(defun c:bh (/ sortents dict  lst Doc)
  (setq  doc
   (vla-get-ActiveDocument
     (vlax-get-acad-object)
   )
  )
  (vlax-for blockdef (vla-get-blocks doc)
    (cond
      (
       (not
   (VL-CATCH-ALL-ERROR-P
     (setq sortents
      (VL-CATCH-ALL-APPLY
        'vla-item
        (list
          (setq dict
           (vla-GetExtensionDictionary
             blockdef
           )
          )
          "ACAD_SORTENTS"
        )
      )
     )
   )
       )
      )
      ((setq sortents
        (VL-CATCH-ALL-APPLY
    'vla-AddObject
    (list dict "ACAD_SORTENTS" "AcDbSortentsTable")
        )
       )
      )
    )
    (setq lst nil)
    (vlax-for obj blockdef
      (if (= "AcDbHatch" (vla-get-objectname obj))
  (setq lst (cons obj lst))
      )
    )
    (if  lst
      (progn
  (vla-MoveToBottom
    sortents
    (vlax-make-variant
      (vlax-safearray-fill
        (vlax-make-safearray
    vlax-vbobject
    (cons 0 (1- (length lst)))
        )
        lst
      )
    )
  )

      )
    )
  )
  (vla-regen doc :vlax-true)
  (princ)
)
回复 支持 1 反对 0

使用道具 举报

发表于 2015-3-24 10:14 | 显示全部楼层
(defun c:tt ()
  
  (if (and
        (setq p1 (getpoint "\n第一点:"))
        (setq p2 (getcorner p1 "\n对角点:"))
        (setq ss (ssget "c" p1 p2))
      )
    (progn
      (command "rectang" p1 p2)
      (setq e (entlast))
      (command "wipeout" "p" e "y")
      (command "draworder" ss "" "a" (entlast) "")
    )
  )
  (princ)
)
 楼主| 发表于 2015-3-24 11:48 | 显示全部楼层
GU 老板!是框选里面区域覆盖置后,不是新作区域覆盖置后。
 楼主| 发表于 2015-3-24 11:48 | 显示全部楼层
Gu_xl 发表于 2015-3-24 10:14
(defun c:tt ()
  
  (if (and


GU 老板!是框选里面区域覆盖置后,不是新作区域覆盖置后。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-6 12:27 , Processed in 0.334628 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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