Jump to content

Recommended Posts

Posted

Hi All

 

Is there a command in Autolisp that allows me to delete all objects on a certain layer?

Posted (edited)

Did you tried LayDel Command ?

Edited by gS7
Posted

Yes I have tried that and of course it works

I guess it was a silly question from the start

Posted

FYI, the laydel command would delete all objects on a certain layer name and delete the layer object itself from the drawing, so if you have other objects in the drawing and even in a block then they would be deleted as well.

 

Finally deleting object(s) on a certain layer does not mean to delete the layer name to delete the object(s) that reside(s) on that layer.

Posted

Thanks again

The idea here is that once I have finished using my construction lines I want to hit a command and they will all be deleted

Posted
On 12/20/2018 at 4:17 PM, TunzaGibbo said:

Thanks again

The idea here is that once I have finished using my construction lines I want to hit a command and they will all be deleted

 

you mean you want to delete all  objects from  "construction lines " layer ?

 

    (setq OB (ssget "x" (LIST (CONS 8 "construction lines" ))))
    (command "Erase" OB "")

 

Posted
On 12/20/2018 at 6:28 PM, Tharwat said:

FYI, the laydel command would delete all objects on a certain layer name and delete the layer object itself from the drawing, so if you have other objects in the drawing and even in a block then they would be deleted as well.

 

Finally deleting object(s) on a certain layer does not mean to delete the layer name to delete the object(s) that reside(s) on that layer.

 

5 hours ago, gS7 said:

 

you mean you want to delete all  objects from  "construction lines " layer ?

 


    (setq OB (ssget "x" (LIST (CONS 8 "construction lines" ))))
    (command "Erase" OB "")

 

I ended up using the "laydel command" and I realized the objects and the layer are deleted. but next time I run my Xline routine I have a little sub-routine that creates the Construction Layer again

 

Thank you though for that little bit of code I'll store it away for another day

  • 9 months later...
Posted
On 12/23/2018 at 9:36 PM, gS7 said:

 

hi,

I try to wrote a script with script writer to erase a layer, but when I use laydel, it doesn't work. 

 

I wrote this : _open *file* _-laydel _name AFURFR-P   _audit _yes _ai_selall _-overkill _done _-purge r * n _-purge _all * n  _Qsave _close

 

but the script stop because when it said enter the layer's name,  all the rest of the command appear, like this.

 

Enter the layer's name : AFURFR-P   _audit _yes _ai_selall _-overkill _done _-purge r * n _-purge _all * n  _Qsave _close

layer's name invalid...

 

can you help me please.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...