rug,
I can't test because I don't have a file with those views set up, but try to get the core of the code working first.
(DEFUN c:pltfile ()
(setq diff 3) ; plot three views
(setq view 2) ; start with view #2
; so it should plot views 2,3,4 right?
(REPEAT diff ; don't see why you need the EVAL
(COMMAND ".-plot" "yes" "" "" "" "Inches"
"" "" "view" view "1:1" "Center"
"yes" "" "yes" "no" "no" "no"
"n" "n" "y" "" "Default"
"Billable" "review" "Laser" "y"
)
(SETQ view (1+ view))
)
)
Does it plot one or none?
If none, try this:
(DEFUN c:pltfile ()
(setq view 2) ; start with view #2
(COMMAND ".-plot" "yes" "" "" "" "Inches"
"" "" "view" view "1:1" "Center"
"yes" "" "yes" "no" "no" "no"
"n" "n" "y" "" "Default"
"Billable" "review" "Laser" "y"
)
)
Does it plot view #2 ??
Looking at the rest of the code, why do you use the while stmt?
Do you want to repeat this plot again?
When you use (WHILE (expression), the value returned from the expression is the test for the WHILE
statement. You used a (setq for the expression. In that case the LAST item in the (setq is returned.
So this is your test (setq diff (1+ (- end view)))
If "starting view" = zero and "ending view" = zero then "diff" = zero and the test is NOT NIL and
the WHILE code will try to execute. If either of the questions is answered by pressing the ENTER key
without entering a number its value becomes nil. So the "(1+ (- end view))" will ERROR because you
can't subtract nil. Therefore you must do more error testing on the input or prevent a non-number input.
(DEFUN c:pltfile ()
(initget 7) ; prevent zero, negative & enter only ; good one time only!!
(SETQ view (GETINT "\n\nWhat is the starting view to plot: "))
(initget 7) ; must use again
(setq end (GETINT "\n\nWhat is the ending view to plot: "))
(setq diff (1+ (- end view))) ; warning, user could have entered 7,2 result (-4)
; so you have to test for that too
(if (> diff 0) ; ok to process
; note we did not test the range of views, if diff 5 there may be only 3 views
; i don't know how to test that
(progn
(SETVAR "cmdecho" 0) ; ERROR here changed this stmt
(PRINC "\n\nPlotting file.")
;; Now were are back to the core function, did you get it to work??
(REPEAT diff
(COMMAND ".-plot" "yes" "" "" "" "Inches"
"" "" "view" view "1:1" "Center"
"yes" "" "yes" "no" "no" "no"
"n" "n" "y" "" "Default"
"Billable" "review" "Laser" "y"
)
(SETQ view (1+ view))
)
(PRINC "\nPlotting finished.")
(SETVAR "cmdecho" 1) ; ERROR here changed this stmt
)
)
(PRINC)
)
Just trying to help out with what little I have learned...
Please correct me if I made an error in explanation.
CAB