- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
the goal of this LISP routine is to input 3 values: the wattage of a solar module (str), the number of areas (int), and tracker (aka string) type (int) (either a 2 or a 3) and output a series of layers named:
"G-ANNO-GCR_AREA 1_XXX(watts)_XX(strings)" ..., "G-ANNO-GCR_AREA N_XXX(watts)_XX(strings)" depending on the int inputted for number of areas. I'm having trouble getting the code to work, I think its a problem with my while loop. this is the error I am getting:
Here is my code:
;;MAKEGCRLAYERS - Lisp routine to replace the tedious process of making GCR Layers
(defun c:MAKEGCRLAYERS()
(setq watts (getstring "\nEnter module wattage :"))
(setq areas_int (getint "\nEnter number of areas :"))
(setq tracker (getstring "\nEnter type of tracker :"))
(setq text " ")
(while (> areas_int 0)
(setq areas_str (itoa areas_int));; makes string version of areas variable
(setq text strcat("G-ANNO-GCR_AREA " areas_str "_" watts "_0" tracker));; combines all strings into correct format
(if (not (tblsearch "layer" text)) (command "-LAYER" "N" text "");; Makes a new layer
(setq areas_int (- areas 1));; decreases areas_int variable by 1
)
)
Solved! Go to Solution.