非常感谢!!
最后一个问题。
为什么这一点不起作用,它会重复,但不会停止,
- (defun c:ct ()
- ;for testing
- ;to find if want to increase or renumber from a selected up
- (setq incre (getstring (strcat "\nDo you want to renumber(1,2) or increment (+1,-2)? <" incre "> :")))
- ;works out the choice made
- (cond ((= (substr incre 1 1) "+")
- (progn
- (setq change 0)
- (setq orgno (atoi (substr incre 2)))
- )
- )
- ((= (substr incre 1 1) "-")
- (progn
- (setq change 1)
- (setq orgno (atoi (substr incre 2)))
- )
- )
- ((<= 1 (atoi incre))
- (progn
- (setq change 2)
- (setq orgno (atoi incre))
- )
- )
- )
- [color=red];this while!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/color]
- (while
- (progn
- (setq ss1 nil) ;select the block for it to be done to.
- (while
- (not
- (setq ss1 (ssget "_:S" '((0 . "INSERT") (66 . 1))))
- )
- )
- ;finds its data
- (setq en (ssname ss1 0))
- (setq ed (entget en))
- ;makes sure its itemballoon
- (setq blkn (cdr (assoc 2 ed)))
- (cond
- ((= blkn "ITEMBALLOON")
- (progn
- (setq edata (entget en))
- (setq edata (entget (entnext (cdr (assoc -1 edata)))))
- ;gives attibutes current number
- (setq itembubbleorg (atoi (cdr (assoc 1 edata))))
- (rever)
- )
- )
- ((not (= blkn "ITEMBALLOON"))
- (Princ "\nYou Must Select the Item Bubble or masslist block")
- )
- )
- )
- )
- )
- (defun rever () ;0, addes the number to the items one,1 takes it away, 2 changes it to selected one, then every item seleted will add one to that (change 3)
- (cond
- ((= change 0)
- (setq itembubblenew (+ itembubbleorg orgno))
- )
- ((= change 1)
- (setq itembubblenew (- itembubbleorg orgno))
- )
- ((= change 2)
- (progn
- (setq change 3)
- (setq itembubblenew orgno)
- )
- )
- ((= change 3)
- (setq itembubblenew (1+ itembubblenew))
- )
- )
- ;creates the number to a string
- (setq interitembubblenew (itoa itembubblenew))
- ;inserts it back to the attribute
- (setq el (subst (cons 1 interitembubblenew) (assoc 1 edata) edata))
- (entmod el)
- )
可能不是函数方法,但需要考虑
杰米 |