明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3223|回复: 8

[求助]将全选改为框选,谢谢! (解决了)

[复制链接]
发表于 2012-12-24 16:45:42 | 显示全部楼层 |阅读模式
本帖最后由 yoyoho 于 2012-12-26 08:09 编辑

将全选改为框选,谢谢!
程序如下:
;Flattening 2D and 3D Object in AutoCAD
; Flatten a 2D and 3D drawing
; This command will set all elevations and points to zero, effectively flattening any 3D drawing.
;
(defun c:flat (/ total-nabor)
(vl-load-com)
(if
(setq total-nabor (ssget "x" '((410 . "model"))))
(progn
(setq total-nabor
(mapcar 'vlax-ename->vla-object
(mapcar 'cadr
(ssnamex total-nabor)

) ;_ end of mapcar
) ;_ end of mapcar
) ;_ end of setq
(foreach i '(1e99 -1e99)
(mapcar (function (lambda (x)
(vla-move x
(vlax-3d-point (list 0 0 0))
(vlax-3d-point (list 0 0 i))
) ;_ end of vla-move
) ;_ end of lambda
) ;_ end of function
total-nabor
) ;_ end of mapcar
) ;_ end of foreach
) ;_ end of progn
) ;_ end of if
(princ)
) ;_ end of defun
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2012-12-24 16:47:48 | 显示全部楼层
(setq total-nabor (ssget "x" '((410 . "model"))))
改为(setq total-nabor (ssget))
 楼主| 发表于 2012-12-24 16:59:02 | 显示全部楼层
感谢 gdslqs 回覆!
刚试了一下!
(setq total-nabor (ssget "x" '((410 . "model"))))
改为(setq total-nabor (ssget))
不行啊!
 楼主| 发表于 2012-12-24 17:01:09 | 显示全部楼层
指令: flat
选取物件: 指定对角点: 找到 2 个
选取物件:
ERROR:损坏的引数类型: lentityp (0 (-13.0124 -17.2568 -30.2692) (0.57735 0.57735
-0.57735))-osnap
目前的物件锁点模式: 端点,中点,中心点,交点
输入物件锁点模式的清单: endp,mid,int,cen
 楼主| 发表于 2012-12-24 23:07:15 | 显示全部楼层
顶一下!
为何
(setq total-nabor (ssget "x" '((410 . "model"))))
改为(setq total-nabor (ssget))
不行呢?
发表于 2012-12-25 10:16:02 | 显示全部楼层
(setq total-nabor (ssget '((410 . "model"))))
     (progn
       (setq total-nabor
              (mapcar 'vlax-ename->vla-object                       
                      (cdr(reverse(mapcar 'cadr
                              (ssnamex total-nabor)

                      ) ;_ end of mapcar
                              ))
              ) ;_ end of mapcar
       ) ;_ end of setq
发表于 2012-12-25 10:18:54 | 显示全部楼层
楼上正解,过滤条件不可省
发表于 2012-12-25 13:51:18 | 显示全部楼层
改为不就行了:
(setq total-nabor (ssget '((410 . "model"))))
 楼主| 发表于 2012-12-26 08:11:09 | 显示全部楼层
感谢 ljpnb 帮忙,谢谢您!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-3 09:00 , Processed in 0.181844 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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