TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Xplod on January 29, 2009, 08:39:38 AM

Title: Plotting automatisation
Post by: Xplod on January 29, 2009, 08:39:38 AM
Hello everyone,

I need help to complete this lisp. I currently run into 3 problems. If any guru here can help solve it, it would be greatly appreciated. Excuse me if my english is bad, it is not my native language. Part of this lisp come from the Afralisp site and it's call Q-Plot.

Ok, fisrt thing, This lisp is working as following : User is asking for a window, then a dcl open a window with some choice of plotting configuration, when the choice is made, it show a preview of the window, when you hit ESC, it ask if you want to continue or cancel, when i hit continue, everything go fine, but i'm not able to figure how to do the cancel one. This is my first issue.

Then, i would like to put some selection on my window with choice to ask user two things : If he only want to plut the current tab, of if he want to plot all paper space tabs.

Last thing, i would like to have to possibility to be able to to use publish with those, so again, radio button for choice, then if you hit the publish one, he send the plot using publish.

If someone could take a look at it, and do something with it, this would surely be something that others can use.

Thanks!

Title: Re: Plotting automatisation
Post by: T.Willey on January 29, 2009, 12:25:22 PM
<snip>
..... when i hit continue, everything go fine, but i'm not able to figure how to do the cancel one. This is my first issue.
It looks like you can use the system variable ' LastPrompt ' for this.  If you plot, then it will say so.  Examples from a little test.
Canceled plot = "Press ESC or ENTER to exit, or right-click to display shortcut menu."
Continued plot = "Plotting viewport 2."

.... Then, i would like to put some selection on my window with choice to ask user two things : If he only want to plut the current tab, of if he want to plot all paper space tabs.
[ http://www.theswamp.org/index.php?topic=1916.0 ]
This is Alan's ( CAB ) plot tabs routine.  You should be able to find what you want there.

Last thing, i would like to have to possibility to be able to to use publish with those, so again, radio button for choice, then if you hit the publish one, he send the plot using publish.
When I did my plot routine with lisp, I had to either plot it more than once when in the drawing, or had to repeat the list of drawings to plot the number of times that I want them plotted.

Hope that helps.
Title: Re: Plotting automatisation
Post by: psuchewinner on January 30, 2009, 10:25:20 AM
Write the info to a "DSD" (drawing set description - I believe) and run the publish command from VLisp.  It works for me.  I am currently working, when I have a chance, on a new version of my QPlot routine that will plot multiple un-opened drawings by automating the publish command.
Title: Re: Plotting automatisation
Post by: Xplod on February 03, 2009, 03:09:47 PM
Thanks for hint

But my lisp knowledge is not the best around. Can someone take my lsp and write down, at least the part for the cancel command to work ? I need this as soon as possible. I've try to make it work for one week but i always bump into some error.

Thank you
Title: Re: Plotting automatisation
Post by: CAB on February 03, 2009, 07:40:58 PM
Try this modification.
Title: Re: Plotting automatisation
Post by: Xplod on February 05, 2009, 12:12:51 PM
Thank's Cab, but there seem to be a problem, when i select ok after the preview, i get the same message as the cancel button : user quit. I've take a look at the lisp, and i could not figure where the error is.

Also, just to know, is there a possibility to ask the user if he want to plot only the current tab or all the tabs ?

Last option, is there a way to add the publish command to this lisp ?

Thank you for your advice
Title: Re: Plotting automatisation
Post by: CAB on February 05, 2009, 02:04:24 PM
Oops.
Try this one.


Yes
and
Yes
 8-)
Title: Re: Plotting automatisation
Post by: Xplod on February 05, 2009, 04:46:27 PM
Hello again Cab

Another error. This is the message i hot when i click ok for printing

Command: ; error: An error has occurred inside the *error* functionbad argument
type: stringp nil

Can't see where is coming from
Title: Re: Plotting automatisation
Post by: CAB on February 05, 2009, 10:00:37 PM
The error is most likely that the variable LayOut is undefined.
You need to set it.

As for the error message An error has occurred inside the *error* function
you have an active error handler that should not be there. This is from a lisp you ran previously
and the error handler for it was not localized. To turn that error handler off use
Code: [Select]
(setq *error* nil)
Title: Re: Plotting automatisation
Post by: alanjt on February 05, 2009, 10:33:57 PM
The error is most likely that the variable LayOut is undefined.
You need to set it.

As for the error message An error has occurred inside the *error* function
you have an active error handler that should not be there. This is from a lisp you ran previously
and the error handler for it was not localized. To turn that error handler off use
Code: [Select]
(setq *error* nil)

alan, if you nil out the *error* function, doesn't that mean you won't have any error function for routines that are not written with one?
i'm really asking this because i've been trying to figure out what routine i have loaded that keeps nilling out the *error*.
Title: Re: Plotting automatisation
Post by: CAB on February 05, 2009, 11:56:30 PM
Setting to nil restores the built in primary lisp error routine.
It kills the one your lisp activated & did not nil.

Only this the primary error routine does is report the error message.

Problem with poorly written error handlers is that when used outside the lisp they were designed for is that they create errors themselves.
Thus the message: An error has occurred inside the *error* function  8-)
Title: Re: Plotting automatisation
Post by: Xplod on February 06, 2009, 11:48:46 AM
Thanks for the help,

However this routine was working very well before i try to add the preview function, and i never give a value to the layout variable.

Can you give me a hint how to solve the problem ?