Thon Posted February 7, 2012 Posted February 7, 2012 I am beating my head on the wall... I have written simple lisps to help with my day to day Cad work. Here is my problem, I am trying to write a routine that creates a group of layers using a common variable. Example: Variable= Lot-01 Resulting layers; Lot-Boundary-Lot-01 Lot-Annot-Perimiter-Lot-01 Lot-Annot-Name-Area-Lot-1 Lot-Set-Backs-Lot-1 Lot-Annot-Tie-Lot-1 It would also set the color and linetype for the layer. Thanks for the help Quote
BIGAL Posted February 7, 2012 Posted February 7, 2012 A simple way could do lots of smarter things (setq ans (getstring "\nEnter variable :")) (setq newans (strcat "Lot-Boundary-" ans)) (command "la" "N" newans "C" 1 "") repeat last 2 lines as required Quote
Thon Posted February 7, 2012 Author Posted February 7, 2012 Thank you. My problem was getting the variable usage correct. Quote
MSasu Posted February 7, 2012 Posted February 7, 2012 For more flexibility you may modify the code BIGAL provided to you to parse a list of prefixes: (foreach newans '("Lot-Boundary-" "Lot-Annot-Perim[color=red]i[/color]ter-" "Lot-Annot-Name-Area-" "Lot-Set-Backs-" "Lot-Annot-Tie-") (setq newans (strcat newans ans)) (command "la" "N" newans "C" 1 "") ) Regards, Mircea Quote
Lee Mac Posted February 7, 2012 Posted February 7, 2012 This post may help: http://www.cadtutor.net/forum/showthread.php?65302-Create-layers-with-LISP&p=447101&viewfull=1#post447101 Quote
Thon Posted February 7, 2012 Author Posted February 7, 2012 Thanks for the help everybody. This was the first time I have used user input in a lisp. I was close but not getting the useage correct. It creates the needed layers quickly and correctly. I also added a line that copies a base layout and names it as the user input. Quote
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.