Trying to rewrite pasteblock to make it working as autocad R14 :::
Pasteblock > Insertion Point > opposite corner (Scale X and Y definition) > rotation
I write the code
(defun c:PasteBlockX ()
(command "_pasteblock" "0,0,0")
(command "_erase" "_L" "")
(princ)
(command "-insert" "")
(princ)
(princ)
)
Creating an object on acad space , copying it to clipboard , closing acad, open acad
The erase command sometimes doesn’t erase the last object (the pasted block instance object) but the previeus created by user object.
Is there something to write to improve the code?
How about:
(command "_erase" (entlast) "")
Another possible approach, if "Last" gets you the last thing visible on the screen [which doesn't seem to be the case in 2015 -- it finds a pasted block when inserted at 0,0 whether visible or not], and assuming [which may not always be valid] that if it's inserted in the center of the current view there will at least be some portion of it visible:
(command "_.pasteblock" (getvar 'viewctr))
Then Erase Last should always find it.
By the way [again in 2015] you do have the [uniform] Scale and [individual] X and Y and Z and Rotation options in Pasteblock, which you can specify before placement, even though it doesn't show them as options.