给楼主参考下吧
- ;;Command / Functions --
- ;;c:AxProps -- prompts you to to select an entity.
- ;;c:NAxProps -- prompts you to to select a nested entity.
- ;;AxProps, syntax: (AxProps x), where x is any valid object, ename or handle.
- (defun c:Propsx ( / mia getkey key lst )
- (cond
-
- ( (and
- (setq mia (null AxProps))
- (null (findfile "axprops.fas"))
- )
- (princ "Cannot find axprops.fas, aborting.")
- )
-
- ( (and
- mia
- (eq 'failed (load "axprops.fas"))
- )
- (princ "Cannot load axprops.fas, aborting.")
- )
-
- ( (defun GetKey ( / result )
- (while
- (null
- (eq 2
- (car
- (setq result (grread))
- )
- )
- )
- )
- (cadr result)
- )
- (setq lst
- (mapcar 'ascii
- '("p" "P" "n" "N" "\r" " ")
- )
- )
-
- (if mia (princ "\n\n"))
- (princ
- (strcat
- "Press [p] or [enter] to select a "
- "primary entity, [n] for a nested one: "
- )
- )
- (while
- (null
- (member
- (setq key (GetKey))
- lst
- )
- )
- )
- (setq ename
- (car
- (if (member key (mapcar 'ascii '("n" "N")))
- (nentsel)
- (entsel)
- )
- )
- )
-
- (vl-load-com)
- (AxProps ename)
- )
- )
- (princ)
-
- )
|