Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the code below I don't know where I should insert an IF statement that when I execute this command it will prompt me "Is this set of layers for std or custom:". If std, which would be the default, it would follow the layerset.dat coding that is already listed. If Custom, type "C" for custom and then it would load, read, a file called layerset1.dat instead. Nothing else would need to change. Thanks for any assistance.
(defun C:LAYERSET ()
(command "redraw")
(SETVAR "REGENMODE" 0)
(COMMAND-S "LAYER""SET""0""")
(COMMAND-S "LAYER""FREEZE""*""")
(prompt "Installing new layers: ")
(terpri)
(prompt " please wait....")
(SAVEMODE
(quote
("CMDECHO" "MENUECHO" "EXPERT")
)
)
(setvar "EXPERT" 0)
(setvar "CMDECHO" 0)
(setvar "MENUECHO" 3)
(setq RFILE (OPEN (strcat lisp "layerset.dat") "r")) ;Opens layerset.dat for read
(setq LAYER (read-line RFILE))
(setq LINETYPE (read-line RFILE))
(setq COLOR (read-line RFILE))
(while (/= LAYER nil)
(command "LAYER" "m" LAYER "lt" LINETYPE LAYER "c" COLOR LAYER "");if linetype does not exist, then, this will be interrupted in the middle
(command ^C^C)
(setq LAYER (read-line RFILE))
(setq LINETYPE (read-line RFILE))
(setq COLOR (read-line RFILE))
) ;end while
(close RFILE)
(terpri)
(SETVAR "REGENMODE" 1)
(COMMAND "LAYER""THAW""*""")
(RESTMODE)
(prompt "\nAll the Layers, Colors, and Linetypes are installed or have been reinstalled....")
(prin1)
)
Solved! Go to Solution.