Search code examples
autocadautocad-pluginautolisp

How can make any entity as last entity in Autocad Autolisp


I am working with AutoCAD electrical 2016. there is "c:aeballoon" command which can be applied to last entity via lisp. if I want to apply this command to any other entity (say Nth entity) in the drawing. so there is one solution if any how make Nth entity as last entity. so this c:aeballoon command can successfully applied to that Nth Entity.

Thank in advance


Solution

  • You can create the following AutoCADLisp Program.

    1. copy the following to notepad

    (defun c:makelast() (command ".copy" "si" (setq kk (car (entsel))) "0,0" "" ".erase" kk "")(princ))

    1. save the file as makelast.lsp

    2. Use Appload command to load the program.

    3. RUn the new command Makelast to select the object you want to make it last.