Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

erase last disfunction

2 REPLIES 2
Reply
Message 1 of 3
GeryKnee
142 Views, 2 Replies

erase last disfunction

 

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?

 

2 REPLIES 2
Message 2 of 3
paullimapa
in reply to: GeryKnee

How about:

(command "_erase" (entlast) "")

 

AOL @ Exchange App Store

DDSetup @ Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 3
Kent1Cooper
in reply to: GeryKnee

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.

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost