I'm a newbie. And i try to practise some Autolisp example.
I write the code below to know how to use entity name in applying command.
I collect these entity name in a list and use command "erase to delete it".
But some problems happened here. It said " Bad arguments" and i don't know how to resolve it.
(defun c:gc (/ p1 p2 data n index)
(setq p1 (ssget))
(setq data())
(setq n (sslength p1))
(setq index 0)
(repeat n
(setq p2 (ssname p1 index))
(setq data (append data p2))
(entmod data)
(setq index (+ index 1))
)
(command "erase" p2 "")
)