明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: mokson

[提问] 如何获取用 List 命令输出的数据?

[复制链接]
发表于 2022-3-2 20:51:00 | 显示全部楼层
三维实体的范围可以试下李迈克的函数 (LM:ssboundingbox(ssget))
 楼主| 发表于 2022-3-3 08:28:44 | 显示全部楼层
guosheyang 发表于 2022-3-2 20:51
三维实体的范围可以试下李迈克的函数 (LM:ssboundingbox(ssget))

请问要下载安装什么插件吗?
发表于 2022-3-3 09:44:49 | 显示全部楼层
;; Selection Set Bounding Box  -  Lee Mac
;; Returns a list of the lower-left and upper-right WCS coordinates of a
;; rectangular frame bounding all objects in a supplied selection set.
;; s - [sel] Selection set for which to return bounding box
;(LM:ssboundingbox(ssget))
(defun LM:ssboundingbox( s / a b i m n o )
    (repeat (setq i (sslength s))
        (if
            (and
                (setq o (vlax-ename->vla-object (ssname s (setq i (1- i)))))
                (vlax-method-applicable-p o 'getboundingbox)
                (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list o 'a 'b))))
            )
            (setq m (cons (vlax-safearray->list a) m)
                  n (cons (vlax-safearray->list b) n)
            )
        )
    )
    (if (and m n)
        (mapcar '(lambda ( a b ) (apply 'mapcar (cons a b))) '(min max) (list m n))
    )
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-29 07:15 , Processed in 0.155178 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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