Author Topic: Creating a Lisp routine  (Read 1473 times)

0 Members and 1 Guest are viewing this topic.

squareknees

  • Guest
Creating a Lisp routine
« on: October 20, 2015, 12:12:49 PM »
Let me preface this by saying I do not understand reading or writing lisp routines. As background, I tend to get blocks online instead of having to draw something that has already been done. Since everyone's preferences on layers is different I tend to spend a lot of time changing layers or fixing line types.
Have you ever gone into a drawing that you created and find that there is a layer that you didn't create? when you try to purge it won't let you because the layer is still in use, and you have to go from block to block that you brought in to see if it has the rogue layer.
So this is what I am looking for, I want a lisp routine that I can use in removal of these rogue layers, linetypes, or whatever.
I was thinking that when starting the lisp routine it would ask what I am looking for and it would give me a list of the blocks that have that layer or linetype associated with it.
As I said at the beginning I can not write lisp routines I don't understand the language of the lisp routine. Is this possible? Has anyone ever created something like this? How hard would it be to create something like this?
Thanks

HasanCAD

  • Swamp Rat
  • Posts: 1422

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Creating a Lisp routine
« Reply #2 on: October 20, 2015, 02:06:51 PM »
Something else to look at in ExpressTools.
LAYDEL


Deletes all objects from the specified layer and purges the layer from the drawing.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Creating a Lisp routine
« Reply #3 on: October 20, 2015, 02:12:16 PM »
More stuff:

Code: [Select]
;;  Layers delete by Leemac
;;  http://www.theswamp.org/index.php?topic=40745.msg460267#msg460267

;;  It will Thaw / Unlock / Turn On the layer (if it exists), then iterate over all blocks in the drawing
;;  (including Modelspace / Paperspace blocks), then, for each block, will iterate over all objects in
;;  the block. If the object resides on the layer in question, the object will be deleted.
;;  Finally, the function attempts to delete the layer from the layer collection.

Code: [Select]
;;  http://cadtutor.net/forum/showthread.php?t=14393
;;  move objects to new layer, delete old layer

;|
*    Change all entitites lied on layer with old-name to a layer named new-layer
* Tried to erase old-name layer
*    Call parameters:
*    old-name    old layer name. Supports wild-cards in name
*    new-name    new layer name.
|;
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: Creating a Lisp routine
« Reply #4 on: October 20, 2015, 02:12:36 PM »
I believe the OP need a lisp to move all Objects to layer 0