
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone,
I am looking to create a LISP routine to create a new layer based on what the user inputs for a name.
I believe my logic flows as follows:
- “Nothing selected” if ran and, well, nothing is selected
- Prompts user for layer name
- Takes user input and “concatenates” it with predetermined text that is before and after the input (ex: user inputs “HVAC”; a layer gets created called “Rev0_HVAC_Line_0” – gibberish text for an example and creates the new layer with static settings (color, linetype, lineweight, etc)
- Takes the objects that were selected and places them on the new layer
- Sets the newly created layer as the current layer
- If layer already exists, prompt user that it does and ask if they would like selected objects to be placed on it - place on layer if yes; if not do nothing
Basically, I can create the new layer (through layers manager), but the user still must manually select the objects, go through the layers and find the correct one, or create one, and hopefully enter the correct name (if the layer name always has the same “prefix” and “suffix”, then why open this to potential error when it can be automated).
I have this code that I have used to make a new layer:
(defun c:UA () (command "_.Layer" "_Make" "Rev0_HVAC_Line_0" "_Color" "10" "" "LType" "PHANTOM2" "" "") (princ) )
I am finding getting user inputs and automation of my task to be quite difficult:
I feel that my process can be automated and save a ton of time for me.
Any help/input on this matter is greatly appreciated.
Thanks!
Solved! Go to Solution.