API and Page Setup

Discussion in 'SolidWorks' started by SW Monkey, Aug 13, 2004.

  1. SW Monkey

    SW Monkey Guest

    I have all of my drawing templates set for "11x17 and Scale to Fit".
    For some reason I cant figure out, these settings get changed to
    "8.5x11 and Scale 100%".

    Can I write a macro that will change the settings when this happens?

    If anyone has any idea why this might happen, please let me know.

    SolidWorks 2003 SP 5
     
    SW Monkey, Aug 13, 2004
    #1
  2. Sure I change the settings before printing
    You have to go through ModelDocExtention I don't know about the paper size
    it might be in there also


    PartExt.UsePageSetup = swPageSetupInUse_Application
    Set PageSettings = PartExt.AppPageSetup

    PageSettings.Orientation = swPageSetupOrient_Landscape
    swApp.SetUserPreferenceIntegerValue _
    swPageSetupPrinterDrawingColor, swPageSetup_BlackAndWhite

    PageSettings.LeftFooter = "Last Plot Date: &[date] &[time]"
    PageSettings.ScaleToFit = True
    PageSettings.PrinterPaperLength = 17 * 254'convert to .1mm
    PageSettings.PrinterPaperWidth = 11 * 254
    'I am not positive about the conversion but that is what it says in API
    help.

    Regards,
    Corey
     
    Corey Scheich, Aug 13, 2004
    #2

  3. Do you know is there a way to get the paper orientation _before_
    printing and print with that option? Now I need a macro for landscape
    printing and another one for portrait. PageSetup.Orientation doesn't seem
    to work correctly..04sp2.1
     
    Markku Lehtola, Aug 16, 2004
    #3
  4. It probably works correctly but there is a setting to use system settings or
    document settings or sheet settings. If you change the system settings to
    your desired orientation and print using document settings you will not
    necessarily get what you want.

    first set the page setup to be used

    PartExt.UsePageSetup = swPageSetupInUse_Application
    'swPageSetupInUse_Document
    'swPageSetupInUse_DrawingSheet

    'for the Page settings object of the app
    Set PageSettings = PartExt.AppPageSetup

    'For the page settings object of the document
    Set PageSettings = Part.Extension.Document.PageSetup

    I don't recall off hand how to set it for the sheet.

    Corey Scheich
     
    Corey Scheich, Aug 16, 2004
    #4

  5. Aaa, now we are cooking :) Thanks.
     
    Markku Lehtola, Aug 16, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.