Kean Walmsley

July 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Twitter Updates

    follow me on Twitter



    « Driving a basic AutoCAD plot using .NET | Main | Previewing and plotting a single sheet in AutoCAD using .NET »

    September 29, 2007

    TrackBack

    TrackBack URL for this entry:
    http://www.typepad.com/services/trackback/6a00d83452464869e200e54f0061828834

    Listed below are links to weblogs that reference Driving a multi-sheet AutoCAD plot using .NET:

    Comments

    Nice code!
    By the way, can you give an example about how to draive a multi-sheet AutoCAD plotpreview using .NET? I try it by myself but have no way. Maybe the PreviewEndPlotInfo Class is helpful, but how to use this class?
    very thanks.

    Sure thing. Today's post looks at single-sheet previewing, while a follow-up post later in the week will look at multi-sheet.

    Kean

    "Operation is not valid due to the current state of the object."

    i am getting this error while running the above code in autocad 2008.it will plot first sheet layout but when it loops back for second sheet it throws this error.

    but the above code works fine for autocad 2006..


    any solution kean?

    Many thanks for the code sample!

    Is it also possible to plot the same layout multiple times? I've got a huge drawing and defined some sheet lines there. Now I want to plot a set of these sheets into one dwg or pdf file. I modified your code accordingly and am iterating through every sheet instead of the "layoutsToPlot". In the loop, I'm zooming to the extents of the current sheet. Unfortunately, the resulting file contains only one page (the one of the last sheet). Am I on the right track with this approach? Which command actually tells AutoCAD to start a new page (has to be another one than pe.BeginPage)?

    Your help is highly appreciated!

    It's hard to know exactly what's happening, based on the description, but one suggestion: make sure you're using a multi-sheet compatible plotter & driver...

    Kean

    Thanks so much for this example.

    I do have a question. I have implemented the code and am using it to plot several drawing files with multiple layouts to PDFs but there seems to be an issue. I am waiting for the PlotFactory.ProcessPlotState to return the NotPlotting status before I start the next drawing. This takes a very long time to return. Is there a better way to accomplish this besides waiting on the NotPlotting status to return before I start the next plot cycle?

    Any assistance is appreciated.

    Eric

    Hi Eric,

    The logical way would be to rely on Background Plotting to avoid the delay. I can't remember whether I tested it with this code, though.

    I'd suggest sending a reproducible sample through to the ADN team, referencing this post.

    Regards,

    Kean

    Hi Kean,

    Do you know how I can get a multi-page DWF file to label all the sheets? I currently have multiple DWG files that I open and create a single multi-page DWF (via C#), but only the first sheet has a name. I can't see where I should be passing names for the other sheets. Thanks.

    Hi Sparky,

    Sorry - I don't know the answer to this one, off the top of my head (and I don't have time to research it, either, right now).

    I'd suggest asking via ADN or the AutoCAD .NET Discussion Group.

    Regards,

    Kean

    Kean,

    First, I'm amazed at the work you do and how quickly you come up with all these examples. Very helpful. Thanks.

    However, I am having the same problem as Sony:

    Operation is not valid due to the current state of the object.

    (AutoCAD - Civil 3d 2009).

    When the tr.GetObject tries to access the 2nd layoutsToPlot using BTR Id, AutoCAD crashes with the above error.

    I use exactly the same code as in more than one of the examples...

    Any ideas for me to try?

    Thanks Again.

    Ray L'Amoreaux
    FDOT

    Ray,

    Thanks for the kind words.

    Do you see this behavior in every drawing? If so, is there something specific about the drawing setup?

    Feel free to email me (or, ideally, submit it via ADN) a drawing which reproduces the problem consistently with no change in the above code.

    Kean

    Hey Kean,

    Love your stuff, hopefully see you in vegas next week. I am having the same trouble as the previous fellas while trying to print:

    "Operation is not valid due to the current state of the object"

    Did you come to a conclusion on this?

    Hi Nick,

    I don't remember seeing anything come through from Ray (although he may have submitted via ADN).

    I'll repeat the offer I made to Ray: if you can send me a drawing and clear steps to reproduce the problem, I'll take a look (after AU :-).

    Be sure to say Hi if you see me in Vegas!

    Kean

    Does Anybody have an idea why am I getting only one Layout (the last one printed) showing up in the dwfx file?
    If I use a pdf printer then I have all may layouts.
    I am using the code shown above translated to VB.net.

    Thanks for your help.
    Peter

    I'm having the same problem as the others. I've tried both C# and converted it over to .Net and it's failing upon reaching the second sheet at

    BlockTableRecord btr =
    BlockTableRecord)tr.GetObject(
    btrId,
    OpenMode.ForRead

    My company won't spring for a membership to ADN, so I've no way to submit the files there, but if you have other ways to get it to you, then I'm more than happy to send them along.
    I'm using C3d 2009 SP1 here along with VS 2008 Express edition.

    Verify your Comment

    Previewing your Comment

    This is only a preview. Your comment has not yet been posted.

    Working...
    Your comment could not be posted. Error type:
    Your comment has been posted. Post another comment

    The letters and numbers you entered did not match the image. Please try again.

    As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

    Having trouble reading this image? View an alternate.

    Working...

    Post a comment

    Feed & Share

    Search