Author Topic: Get Number of copies.  (Read 5219 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Get Number of copies.
« on: December 06, 2007, 03:17:33 PM »
Hi all,

I'm trying to get the last number of plot copy..

Code: [Select]
(vl-load-com)
(vla-get-NumberOfCopies
(vla-get-Plot
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
))

But this code return me always 1
Can anyone explain me why ?

thanks.
Keep smile...

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Get Number of copies.
« Reply #1 on: December 06, 2007, 03:26:04 PM »
I think that this always resets to 1 after the plot completes. Try plotting from the Acad editor, change the # of copies to 2, complete the plot. Now go back to plot again, note the # of copies is 1 again?


Andrea

  • Water Moccasin
  • Posts: 2372
Re: Get Number of copies.
« Reply #2 on: December 06, 2007, 03:34:12 PM »
Thanks Jeff for you quick response..

but if it is, what is the utility to have the vla-get-NumberOfCopies function ?
and where to use this ? I can't find any sample on the net.
Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Get Number of copies.
« Reply #3 on: December 06, 2007, 03:40:49 PM »
I wonder if you could use that in the end command reactor to get the correct number of prints?  /guess

Edit:  Nope.  Didn't work here on a quick test.
« Last Edit: December 06, 2007, 03:44:30 PM by T.Willey »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Get Number of copies.
« Reply #4 on: December 06, 2007, 03:42:42 PM »
Thanks Mr. Willey

This option was tried...

any else ? or in simple lisp maybe ?

Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Get Number of copies.
« Reply #5 on: December 06, 2007, 03:45:35 PM »
Not that I can see.  Maybe in a more powerful language, but that is just a guess also.  Sorry.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

deegeecees

  • Guest
Re: Get Number of copies.
« Reply #6 on: December 06, 2007, 04:21:38 PM »
I use a database for this, and just incremement by one every time the drawing is plotted. Not sure if this is a solution, but figgered I'd throw it out there.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Get Number of copies.
« Reply #7 on: December 06, 2007, 04:54:40 PM »
I use a database for this, and just incremement by one every time the drawing is plotted. Not sure if this is a solution, but figgered I'd throw it out there.
I think the question is more if the person prints it twice within one print command, how do you know that you just printed twice instead of only one.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

deegeecees

  • Guest
Re: Get Number of copies.
« Reply #8 on: December 06, 2007, 05:02:08 PM »
Ahh yes. Never had the need to play with that.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Get Number of copies.
« Reply #9 on: December 06, 2007, 05:06:27 PM »
No time to check this out, but can you get the correct NumberofCopies when the BeginPlot Event is triggered?

KewlToyZ

  • Guest
Re: Get Number of copies.
« Reply #10 on: December 06, 2007, 10:03:24 PM »
Just curious, if your using a newer version (2008) is PUBLISHCOLLATE set to 0?
Publishcollate generates publishing as a single file instead of multiple files.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Get Number of copies.
« Reply #11 on: December 07, 2007, 01:28:00 PM »
thank Kew..  :-)

I don't know about PUBLISHCOLLATE I'll give it a try monday at the office

Have a nice W.E. all.

Keep smile...

daron

  • Guest
Re: Get Number of copies.
« Reply #12 on: December 10, 2007, 08:48:25 AM »
I use a database for this, and just incremement by one every time the drawing is plotted. Not sure if this is a solution, but figgered I'd throw it out there.
I think the question is more if the person prints it twice within one print command, how do you know that you just printed twice instead of only one.
Wouldn't (setq varname (vla-get-numberofcopies (...))) save the number of copies in varname? You could set this as a global variable for use later or set it in one of the integer variables, could you not?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Get Number of copies.
« Reply #13 on: December 10, 2007, 11:04:46 AM »
I use a database for this, and just incremement by one every time the drawing is plotted. Not sure if this is a solution, but figgered I'd throw it out there.
I think the question is more if the person prints it twice within one print command, how do you know that you just printed twice instead of only one.
Wouldn't (setq varname (vla-get-numberofcopies (...))) save the number of copies in varname? You could set this as a global variable for use later or set it in one of the integer variables, could you not?
I don't think it can be done with lisp.  I checked that property in my plot reactor, but it would print out 1 when it should have been 3.  I think you would have to got at least with VBA as Jeff pointed out, with the BeginPlot event.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

daron

  • Guest
Re: Get Number of copies.
« Reply #14 on: December 10, 2007, 12:19:03 PM »
That's odd. I inspected:
Code: [Select]
(setq noc (vla-put-NumberOfCopies (vla-get-Plot (vla-get-ActiveDocument (vlax-get-acad-object))) 3))with a result of nil, then inspected:
Code: [Select]
(vla-get-numberofcopies (vla-get-Plot (vla-get-ActiveDocument (vlax-get-acad-object))))with a return value of 3. If you just inspect the (vla-get-plot (...)), you should see a <NumberOfCopies> 3 in the inpection popup in the vlide. Maybe I'm just not understanding what's being asked here, but it seems retained to me. Using 2006 plain. What all that really tells me, is you don't even need to setq varname this one.