Syntax to check the return code from Plot.PlotToDevice()

Syntax to check the return code from Plot.PlotToDevice()

Markeckert
Enthusiast Enthusiast
688 Views
7 Replies
Message 1 of 8

Syntax to check the return code from Plot.PlotToDevice()

Markeckert
Enthusiast
Enthusiast

I'm experiencing random failures when executing the Plot.PlotToDevice routine. The return code seems to always be a -1 regardless of whether the function is successful or not. Is there another way I can check to see if this routine has failed? I maybe checking the return code incorrectly. Can someone provide the syntax for checking the return code?

Thanks

 

0 Likes
689 Views
7 Replies
Replies (7)
Message 2 of 8

Ed__Jobe
Mentor
Mentor

I kinda gave up because you wouldn't answer my questions.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 8

Markeckert
Enthusiast
Enthusiast

Ed, Could you please state what your questions are. I'd be happy to answer them.

0 Likes
Message 4 of 8

Markeckert
Enthusiast
Enthusiast

I'm attaching my code incase it wasn't received before.

0 Likes
Message 5 of 8

Ed__Jobe
Mentor
Mentor

@Markeckert wrote:

Ed, Could you please state what your questions are. I'd be happy to answer them.


I didn't realize you started another thread on the same subject, but I mentioned post 6 several times.

Is this an out-of-process application?

What is the goal? e.g. I want to plot several dwg's into one pdf. or I want to batch plot a bunch of dwgs, one pdf per dwg, from an external app without opening acad.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 6 of 8

Markeckert
Enthusiast
Enthusiast

The VB app plots several DWG files into one PDF. Every time I run it using the same input DWG files I get a different result. Sometimes it will produce a PDF with all the DWG files and other times a DWG file or two will be missing from the output PDF. Here is the flow of the process. The first part of the process plots each DWG file into a separate PDF (these will be combined later). It uses the routine Plot.PlotToDevice(). This first step is where the process sometimes fails. When it fails, I end up with an empty PDF file. If I could trap the error, I could have it perform a retry of the routine, but I haven't been able to catch an error.

0 Likes
Message 7 of 8

Ed__Jobe
Mentor
Mentor

You keep trying to explain the problem with your current code, without answering my questions. "The VB app plots several DWG files into one PDF." This is the closest you came to answering them. I'm trying to get you to explain what you want the user to be able to do, nothing to do with programming code. Maybe you don't understand what "out-of-process" means. VBA and .NET dll's run within AutoCAD's process, i.e. the memory chain that is created by acad.exe. An out-of-process app is a different exe that tries to control the acad.exe process. In other words, is your app a dll that has to be NETLOADED, or is it an exe?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 8 of 8

Markeckert
Enthusiast
Enthusiast
The App is an out-of-process app. It's a Visual Basic exe.
0 Likes