乐筑天下

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

[编程交流] 层分解

[复制链接]

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 16:28:20 | 显示全部楼层
好的,局部变量:
 
  1. ; Lxplode by ASMI - modified slightly (and hopefully correctly) by Lee McDonnell
  2. (defun c:lxplode2 (/ ss ssl index eEnt cLay lEnt cDxf nDxf)
  3.    (setq ss (ssget))
  4.    (if    (/= (setq ssl (sslength ss)) nil)
  5.    (progn
  6.        (setq index 0)
  7.        (repeat ssl
  8.        (setq eEnt (ssname ss index)
  9.              cLay (cdr (assoc 8 (entget eEnt)))
  10.              lEnt (entlast)
  11.        ) ; end setq
  12.        (if (and
  13.            (vl-cmdf "_.explode" eEnt)
  14.            (not (equal lEnt (entlast)))
  15.            ) ; end and
  16.            (progn
  17.            (while (setq lEnt (entnext lEnt))
  18.                (setq cDxf (entget lEnt)
  19.                  nDxf (subst (cons 8 cLay) (assoc 8 cDxf) cDxf)
  20.                ) ;_  end setq
  21.                (entmod nDxf)
  22.            ) ; end while
  23.            (princ (strcat "\nEntities exploded onto layer " cLay "."))
  24.            ) ; end progn
  25.            (princ "\n<!> Can't explode this entity <!> ")
  26.        ) ; end if
  27.        (setq index (1+ index))
  28.        ) ;_  end repeat
  29.    ) ;_  end progn
  30.    (princ "\nNo Entities Selected!")
  31.    ) ;_  end if
  32.    (princ)
  33. ) ; end of c:lxplode2
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-5-28 03:35 , Processed in 1.076518 second(s), 52 queries .

© 2020-2025 乐筑天下

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