I've a lisaproutine that requires a certain block defined in the drawing. A solution was inserting the block into the drawing and erasing it immediately. I used erase and ten "last". The problem is when the insertion point is outside view it erases a different "last" object.
(defun insertblock
(defun inserting (BLOCK scale / BASEPOINT)
(setq BASEPOINT (list 0 0 0))
(command "-insert" BLOCK "s" 1 BASEPOINT "")
(princ)
) ; end inserting
(inserting "CERTAINBLOCK" 1)
(command "erase" "last" "")
(princ)
) ; end insertblock
1. The first question is how can I erase that last inserted block?
2. The second question is, how can I see that the block is already defined in the drawing.
The following is not working.
(if (tblsearch "block" CERTAINBLOCK )
(go further with lisp) ; block exist
(insert block and go further with lisp) ; block doesn't exist ) ; end if
Thanks,
Laura
(defun insertblock
(defun inserting (BLOCK scale / BASEPOINT)
(setq BASEPOINT (list 0 0 0))
(command "-insert" BLOCK "s" 1 BASEPOINT "")
(princ)
) ; end inserting
(inserting "CERTAINBLOCK" 1)
(command "erase" "last" "")
(princ)
) ; end insertblock
1. The first question is how can I erase that last inserted block?
2. The second question is, how can I see that the block is already defined in the drawing.
The following is not working.
(if (tblsearch "block" CERTAINBLOCK )
(go further with lisp) ; block exist
(insert block and go further with lisp) ; block doesn't exist ) ; end if
Thanks,
Laura