马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 abc498091367 于 2014-11-11 10:09 编辑
下面代码,怎么才能让它默认选中“2层3层4层”3个层,默认选中它,现在功能是每次使用都要去框选。![](source/plugin/imc_colorcode/images/loading.gif) - (defun C:DB (/ ss PL NPL R D STARTPT DIST REMAIN N I PT PT2 PT3 OS E EE)
- (setq OS (GETVAR "osmode"))
- (SETVAR "cmdecho" 0)
- (if (not (tblsearch "layer" "db"))
- (command "layer" "n" "db" "c" "232" "db" ""))
- (command "layer" "s" "db" "")
- (command "_.undo")
- (command "be")
- (SETVAR "osmode" 0)
- (setq R 0.5)
- (setq D 3.0)
- (setq PL nil)
- (setq PT3 nil)
- (if(setq ss(ssget '((0 . "*line,arc,ellipse,circle"))))
- (progn
- (princ "\n正在生成圆,请稍后!\n")
- (while (setq pl(ssname ss 0))
- (setq STARTPT (vlax-curve-getStartPoint PL))
- (setq DIST (vlax-curve-getDistAtParam PL (vlax-curve-getEndParam PL)))
- (setq REMAIN (REM DIST D))
- (setq N (FIX (/ DIST D)))
- (if (> REMAIN 10.0)
- (setq N (1+ N))
- )
- (setq I 0)
- (repeat N
- (setq PT (vlax-curve-getPointAtDist PL (* I D)))
- (setq PT2 (vlax-curve-getClosestPointTo PL PT))
- (setq PT (MAPCAR '(LAMBDA (E1 E2) (/ (+ E1 E2) 2.0)) PT PT2))
- (command "_.circle")
- (command PT)
- (command R)
- (setq I (1+ I))
- )
- (setq ss(ssdel pl ss))
- )
- (princ "\n圆生成完成,欢迎使用!")
- )
- )
- (SETVAR "osmode" OS)
- (command "_.undo")
- (command "e")
- (PRINC)
- )
|