playerdraft123 Posted November 14, 2012 Share Posted November 14, 2012 Hello, I am hoping that someone can help me with creating a lisp routine that will search an open drawing for a specific layer, and if that layer doesn't exist within the drawing, then the lisp routine will create it (specifying a color, linetype, etc). Any help on this would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 14, 2012 Share Posted November 14, 2012 (edited) Welcome to CADTutor. This old post may be of use to you. Also, consider: (if (tblsearch "layer" "[color=red]YourLayerName[/color]") ;; Layer exists ;; Layer does not exist ) Edited November 14, 2012 by BlackBox Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 14, 2012 Share Posted November 14, 2012 Lots of examples are there in the forum , just search and you would get what you looking for . Quote Link to comment Share on other sites More sharing options...
playerdraft123 Posted November 14, 2012 Author Share Posted November 14, 2012 This old post may be of use to you. Thanks Renderman, I am pretty new to this. I tried to pick my way through the code in the post that you linked to without much success. It looks like it picks a layer from an excel (csv) file. I will try to find something on the forums to accompany the table search function that you posted, and post my results. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted November 14, 2012 Share Posted November 14, 2012 Thanks Renderman, I am pretty new to this. I tried to pick my way through the code in the post that you linked to without much success. It looks like it picks a layer from an excel (csv) file. I will try to find something on the forums to accompany the table search function that you posted, and post my results. You're welcome. If you're just starting out, you might consider the -LAYER Command, before getting into some of the complexities inherent to the CSV method noted in my other post. Quote Link to comment Share on other sites More sharing options...
rkent Posted November 14, 2012 Share Posted November 14, 2012 Hello, I am hoping that someone can help me with creating a lisp routine that will search an open drawing for a specific layer, and if that layer doesn't exist within the drawing, then the lisp routine will create it (specifying a color, linetype, etc). Any help on this would be greatly appreciated. (command "-layer" "make" "text" "color" "7" "" "") or (command "-layer" "m" "text" "c" "7" "" "") If the layer exists it just makes it the current layer, sets the color to 7, if the layer doesn't exist it makes it and set the color to 7. Quote Link to comment Share on other sites More sharing options...
playerdraft123 Posted November 15, 2012 Author Share Posted November 15, 2012 Thanks for all of your help everyone! rkent, your post was exactly what I was looking for Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 15, 2012 Share Posted November 15, 2012 The following tutorial post may also help: http://www.cadtutor.net/forum/showthread.php?65302-Create-layers-with-LISP&p=447101&viewfull=1#post447101 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.