hosannabizarre 发表于 2022-7-6 10:39:59

Fix 'unselectable' o

It is not an uncommon problem for AutoCAD users to find unselectable or phantom elements in their drawings.
 
An effective remedy to this issue are the following steps:
 
1. select all
2. erase
3. "oops"
 
...then the unselectable element become selectable, and you get on with your day.
 
We have received a set of drawings where these phantom elements crop up quite regularly.
 
I want to make a lisp, and then a button, to run the commands listed above.
 
I can't quite get it to work right. This is what I've done:
 
(defun c:fixphantoms ()
(command "_ai_selall")
(command "_.erase")
(command "oops")
)
(princ)
)
 
If I run this is leaves me at a position where I am prompted to select objects (which I don't want).
 
If I go: Cntrl+A, then press delete, then type "oops", it's all over and my phantoms are fixed.
 
Can someone please advise how I can change the lisp code so that the three commands get executed and I'm not at a prompt to 'select objects'.
 
Thanks

CALCAD 发表于 2022-7-6 11:17:49

Try writing the command so : (command "_ai_selall" "")

hosannabizarre 发表于 2022-7-6 11:30:00

Thanks CALCAD
 
Gave that a try, but I'm still having the same issue
where, after running "fixphantoms", I'm prompted to select objects.
 
Cheers for the suggestion

CALCAD 发表于 2022-7-6 11:45:38

hosannabizarre,
Sorry, I thought that would work, but alas. I don't have the ai_selall command in my Bricscad or Intellicad, so I don't know the proper syntax. You might try Selgrips as in : (command "._selgrips" "all" ""), which may accomplish the same thing. Just a thought.
页: [1]
查看完整版本: Fix 'unselectable' o