Display full version of the post: Create New Layer w/ modifiers

kameron1967
30.01.2011, 18:13
Hi guys,
 
I wonder if you could help me.  I wanted to create options to modify an existing layer by creating new layers from whichever item I choose by adding one of these modifiers -N-PKG1 or -D-PKG1 or -V-PKG1 when creating a new layer.  So if an entity selected is on a layer called A-ANNO, I would like the option to choose letters N or D or V to decide which modifier to create from existing layer A-ANNO.  So if I choose N, it will create a new layer called A-ANNO-N-PKG1.
 
I'm not sure what the best approach is.  The easiest option would be to first choose either A or D or V before selecting an entity's layer and make a new layer.  A more sophisticated option would be to choose first, then decide on the modifier.  If anyone would like to guide me through the process, I sure would really appreciate it.  Thanks, again!

CarlB
31.01.2011, 03:11
It's no more difficult to allow user to decide after picking.
 
(setq PickItem (car (entsel "\nPick object for new layer: ")))
(setq ObjLayer (cdr (assoc 8 (entget pickItem))))

(setq ObjType (cdr (assoc 0 (entget pickItem))))
(princ (strcat ObjLayer is layer name of " ObjType " selected"))
(initget "N D V")
(Setq LyrSuffix (getkword "\nEnter suffix type [N-PKG-1/D-PKG1/V-PKG-1]:"))
..you can take it from here...:)