TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on December 06, 2007, 03:17:33 PM
-
Hi all,
I'm trying to get the last number of plot copy..
(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.
-
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?
-
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.
-
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.
-
Thanks Mr. Willey
This option was tried...
any else ? or in simple lisp maybe ?
-
Not that I can see. Maybe in a more powerful language, but that is just a guess also. Sorry.
-
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 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.
-
Ahh yes. Never had the need to play with that.
-
No time to check this out, but can you get the correct NumberofCopies when the BeginPlot Event is triggered?
-
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.
-
thank Kew.. :-)
I don't know about PUBLISHCOLLATE I'll give it a try monday at the office
Have a nice W.E. all.
-
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 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.
-
That's odd. I inspected:
(setq noc (vla-put-NumberOfCopies (vla-get-Plot (vla-get-ActiveDocument (vlax-get-acad-object))) 3))
with a result of nil, then inspected:
(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.
-
That's odd. I inspected:
(setq noc (vla-put-NumberOfCopies (vla-get-Plot (vla-get-ActiveDocument (vlax-get-acad-object))) 3))
with a result of nil, then inspected:
(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.
Don't put the property, just plot and in the dialog tell it you want three plots. I did pdf's not to waste paper, then check the value. Mine said 1 even though it should have said 3.
-
No, I understand that. I thought this was a coding question. If you set the put-NOC to a value, then the get-NOC to a variable, immediately after it, you should have the value contained and be able to reuse it within the same call or be sure and set the variable globally... Hmm. Just had a thought, if he wanted to go from drawing to drawing, even a variable in global scope wouldn't work. However, I wonder if vl-bb-set and -ref would be useful. I haven't messed with them in a while. Then again, a long workaround would be to write-line it to a txt file somewhere as write not append, then always call that info from the text file when plotting in another drawing.