Author Topic: QuikPlot  (Read 7473 times)

0 Members and 1 Guest are viewing this topic.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« on: October 23, 2003, 05:22:55 PM »
Hey guys...need some real quick help here...user enters the first view that he wants to plot, then the ending number. from there it goes on and plots all of the view in between. you will notice that I have a few things near the end that are weird... (SMARTPLOT is the reason for that.) Each time I try to run it, I get bad argument type: (or stringp symbolp): nil...I am sorry for the stupid question...but never stupid unless its not asked. :)

Code: [Select]
(DEFUN c:quikplot ()
  (SETVAR cmdecho "0")
  (SETQ view (GETINT "\n\nWhat is the starting view to plot: ")
end  (GETINT "\n\nWhat is the ending view to plot: ")
  )
  (SETQ diff (- view end))
  (WHILE
    (<= view end)
     (STRCAT "\n\nPlotting file.")
     (REPEAT diff
       (COMMAND ".plot"    "y"  "" ""    ""    ""  "" ""
""    (strcat (rtos view))  ""  "" ""    ""    ""  "" ""
""    ""    ""  "" ""    ""    "review" "laser"
""
      )
       (SETQ view (1+ view))
     )
  )
  (setvar cmdecho "1")
  (PRINC)
)


Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« Reply #1 on: October 23, 2003, 05:54:30 PM »
Well...I have this now...what a difference...but it only plots my first view.

Code: [Select]
(DEFUN c:pltfile ()
  (WHILE
    (SETQ view   (GETINT "\n\nWhat is the starting view to plot: ")
 end   (GETINT "\n\nWhat is the ending view to plot: ")
 diff   (1+ (- end view))
 pltviews (COMMAND ".-plot" "yes"    ""       ""
   ""     "Inches" ""       ""
   "view"   view     "1:1"    "Center"
   "yes"    ""      "yes"    "no"
   "no"     "no"     "n"      "n"
   "y"     ""      "Default"
   "Billable"      "review" "Laser"
   "y"
  )
    )
     (SETVAR cmdecho "0")
     (PRINC "\n\nPlotting file.")
     (REPEAT (EVAL diff)
       pltviews
       (SETQ view (1+ view))
     )
     (PRINC "\nPlotting finished.")
     (SETVAR cmdecho "1")
  )
  (PRINC)
)


Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« Reply #2 on: October 24, 2003, 06:19:05 PM »
Well, I tried working this our other ways, but I am still unable to have it continue onto the next view....I have also tried removing the while, and eval's but still just prints the first view in the sequence...Any ideas would help.
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Bill::Meat4Brains

  • Guest
QuikPlot
« Reply #3 on: October 24, 2003, 06:45:55 PM »
there was a discussion about his over at vbdesign quite a while ago.  I will see if I can find a link.

Are these views that you are plotting on different ps tabs?

make the next view the current view first?

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« Reply #4 on: October 24, 2003, 06:49:05 PM »
These are all views on the same tab....I have to keep all of my sheets on one tab for our survey department which uses R14/SDSK8 still....so when I have 60 houses to plot out, i want to be able to plot my prelims out asap. I all ready created a prog to help me with my view creation, just need the plotting part.

Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
QuikPlot
« Reply #5 on: October 24, 2003, 10:18:40 PM »
rug,

Why won't this way work??


Code: [Select]
(DEFUN c:pltfile ()
  (WHILE
    (SETQ view (GETINT "\n\nWhat is the starting view to plot: ")
 end  (GETINT "\n\nWhat is the ending view to plot: ")
 diff (1+ (- end view))
    )
     (SETVAR cmdecho "0")
     (PRINC "\n\nPlotting file.")
     (REPEAT (EVAL 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")
  )
  (PRINC)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« Reply #6 on: October 25, 2003, 02:00:06 AM »
CAB, I am gonna have to try that in the morning...gotta work this weekend...again....I have to digitize a 5 acre parcel from a scanned image....after I find a ref point...but I will try this out, and let you know....

Thx-
Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« Reply #7 on: October 25, 2003, 01:29:10 PM »
CAB - I tried what you had revised it to be, but no go....i tried a little tweaking, and was still unable to get it to go at all now....here is what I have.

Code: [Select]
(DEFUN c:pltfile ()
  (WHILE
    (SETQ view (GETINT "\n\nWhat is the starting view to plot: ")
 end  (GETINT "\n\nWhat is the ending view to plot: ")
 diff (- end view)
    )
     (SETVAR cmdecho "0")
     (PRINC "\n\nPlotting file.")
     (COND
       (IF
(OR
 (/= view 0)
 (<= view end)
 (REPEAT (EVAL 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")
  )
  (PRINC)
)


Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
QuikPlot
« Reply #8 on: October 25, 2003, 02:37:05 PM »
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.


Code: [Select]
(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:
Code: [Select]
(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.

Code: [Select]
(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
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
QuikPlot
« Reply #9 on: October 26, 2003, 12:14:07 PM »
CAB -
That worked perfectly....as you might be able to tell, I am at work AGAIN....With your assistance, I was just able to plot out 120 11x17's in 5 minutes.....Thanks imensely man!!!!! :) :) :) :) :)....I see exactly where I was going wrong and what not...when I get home this evening I will post another reply, and let you know my reasoning on somethings, and why I was headed the dir I was going in.

Rug
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017