cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

selection of objects required to remove part numbers

selection of objects required to remove part numbers

get rid of the if-no-objects-selected-then-then-delete-all-part-numbers function from the _AstM5equalpartsReset command!!

 

the number of times I have accidentally deleted all part numbers from my model because my objects had become unselected (often because I changed the MP/SP toggle switch after selecting the members) and then not discovered my error until a few hours later, has become alarming. (truthfully, doing it once is more than enough)

3 Comments

This could be done by using not the original command. If you use a lisp file, this could be proofed.
I'm not really firm with lisp, but I could google, copy and change it to my needs 🙂
So here a lisp text which will do what you want:

(defun C:delnum (/ ce ssdr)
(setq ce (getvar "cmdecho"))
(setvar "cmdecho" 0)
(if (ssget "_I")
(command "_AstM5equalpartsDelNumber")
(progn
(princ "\nnothing selected...do it! ")
(setvar "nomutt" 1)
(setq ssdr (ssget))
(setvar "nomutt" 0)
(command "_AstM5equalpartsDelNumber")
)
)
)


If you load the lisp and create a button for the command it will work smooth

steve
Participant

@Sebastian_Eiche you sir, are a scholar and a gentleman!

 

that works brilliantly. I prefer the _AstM5equalpartsReset command and edited the code accordingly. 

 

I still think Autodesk needs to drop the default delete-everything function, it is absurd. Until they do, however, I shall be using your code. Thank you so much.

 

Now I just need to figure out how to change the ribbon button so it references your code instead of the standard command....

the original command is set in the cuix, I would not change it. my preference would be to create a new command and replace it in the ribbon

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea