ncopy的行为是否与其他命令不同?我已经试着将选择传递给它,但我无法让它正常工作。
- (defun c:ncopy2 (/ *error* whilestop ent oldecho)
- (defun *error* (msg)
- (if oldecho
- (setvar 'cmdecho oldecho)
- )
- (if (not
- (member msg '("Function cancelled" "quit / exit abort"))
- )
- (princ (strcat "\nError: " msg))
- )
- (princ)
- )
- (setq oldecho (getvar 'cmdecho))
- (setvar 'cmdecho 0)
- (setq whilestop t)
- (while whilestop
- (setvar 'errno 0)
- (setq ent (entsel "\nSelect nested objects to copy: "))
- (cond
- ((= 52 (getvar 'errno))
- (setq whilestop nil)
- )
- ((null ent)
- (princ "\nYou missed. Try again.")
- )
- ((not (wcmatch (setq typ (cdr (assoc 0 (entget (car ent)))))
- "INSERT"
- )
- )
- (princ "\nNot a valid object, try again.")
- )
- ;| ((/= (vla-get-IsXref (vlax-ename->vla-object (car ent))))
- (princ "\nNot a valid object, try again.")
- )|;
- (t
- (command "_.ncopy" ent "" "_non" '(0 0) "_non" '(0 0))
- (princ)
- )
- )
- )
- (setvar 'cmdecho oldecho)
- (princ)
- )
|