明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 728|回复: 10

[提问] 求求各位高手帮忙改一下程序。删除黄色图元

[复制链接]
发表于 2020-3-24 22:28 | 显示全部楼层 |阅读模式
求求各位高手帮忙改一下程序。删除黄色图元
;;;;;;;选   颜色     删除图元  
(defun c:ES4(/ ssys4)(princ "\n删除选取的黄色图元")
  (if
    (setq ssys4 (ssget '((-4 . "<or") (62 . 2) (-4 . "or>"))))
    (command "erase"  "ssys4")
   )
(princ)
)

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2020-3-24 22:54 | 显示全部楼层
本帖最后由 x_s_s_1 于 2020-3-24 22:55 编辑
  1. ;;;光颜色不区分图元类型,删除(assoc 0 ent)
  2. ;;;拾取特征颜色
  3. (defun c:sbc (/ en ent ss)
  4.   (setq        en  (car (entsel "\n拾取特征颜色(非随层):"))
  5.         ent (entget en)
  6.   )
  7.   (if (assoc 62 ent)
  8.     (progn (prompt "\n框选:")
  9.            (setq ss (ssget (list (assoc 0 ent) (assoc 62 ent))))
  10.            (sssetfirst nil ss)
  11.     )
  12.   )
  13. )
发表于 2020-3-25 11:53 | 显示全部楼层
  1. (defun c:ES4(/ ssys4)
  2.   (princ "\n删除选取的黄色图元")
  3.   (if
  4.     (setq ssys4 (ssget '((-4 . "<or") (62 . 2) (-4 . "or>"))))
  5.     (command "erase"  ssys4 "")
  6.    )
  7. (princ)
  8. )

发表于 2020-4-17 16:09 | 显示全部楼层
(defun c:es4(/ ss)(if(setq ss(ssget(list(cons 62 2))))(vl-cmdf "ERASE" ss))(princ))
发表于 2020-4-17 16:51 | 显示全部楼层
(defun c:es4(/ ss)
(prompt  "\n1-红色,2黄色,3绿色,4青色,5蓝色,6洋红色......")
(setq ysz (getint "\n请输入0~256 之间的自然数"))
   (if     
      (setq ss(ssget
                             (list
                                (cons 62 ysz)
                              )
                    )
      )
(command "erase" ss "")
   )
(princ)
)
 楼主| 发表于 2020-4-18 19:06 | 显示全部楼层
香远益清 发表于 2020-4-17 16:51
(defun c:es4(/ ss)
(prompt  "\n1-红色,2黄色,3绿色,4青色,5蓝色,6洋红色......")
(setq ysz (getint "\ ...

谢谢,兄弟,谢谢你帮忙
 楼主| 发表于 2020-4-18 19:07 | 显示全部楼层
qijun0818 发表于 2020-4-17 16:09
(defun c:es4(/ ss)(if(setq ss(ssget(list(cons 62 2))))(vl-cmdf "ERASE" ss))(princ))

谢谢,兄弟,谢谢你帮忙
 楼主| 发表于 2020-4-18 19:08 | 显示全部楼层

谢谢,兄弟,谢谢你帮忙
 楼主| 发表于 2020-4-18 19:08 | 显示全部楼层

谢谢,兄弟,谢谢你帮忙
发表于 2020-5-8 10:14 | 显示全部楼层
有难度,新手来学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-14 22:12 , Processed in 1.614976 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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