Results 1 to 6 of 6

Thread: What is procedure for setting Plot Offset?

  1. #1
    Member
    Join Date
    2007-12
    Posts
    4
    Login to Give a bone
    0

    Default What is procedure for setting Plot Offset?

    I have AutoCad 2004.

    On the Plot Menu, there is a box that contains the CenterPlot checkbox, and also has "Plot Offset" coordinates in X and Y. I need to know how to set these from VBA.

    I can't find reference to this either in the AutoCad VBA Reference or within my Layout structure in VBA (where Layout = ThisDrawing.ModelSpace.Layout).

    Any help will be appreciated.
    Thanks, gpapp

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,594
    Login to Give a bone
    0

    Default Re: What is procedure for setting Plot Offset?

    You have to do a little math. Add your own offsets to the PlotOrigin property. Get the original, calculate each new x,y,z coord and replace the prop value.
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2007-12
    Posts
    4
    Login to Give a bone
    0

    Default Re: What is procedure for setting Plot Offset?

    OK, I will try doing the suggested calculations and setting them in VBA.

    To elaborate on the reason for the question, I am doing a batch plotting routine that
    uses "Zoom extents" on each layout. Then the plot settings in VBA are as follows:

    PlotType = acDisplay
    UseStandardScale = True
    CenterPlot = True
    PlotRotation = ac180degrees (upside-down )
    (Landscape orientation is inherited from the Plot Device)

    When I issue the command to plot, about 90 percent of the files come out OK, but
    1 in 10 appears offset on the page, and then we noticed that there was a non-zero entry in the X or Y value of the plot offset menu.

    So the underlying question is, what within the individual drawing files is causing this behavior? I would have thought that using Zoom Extents then setting the PlotType to acDisplay would be a foolproof way of insuring a drawing that fit the plot drivers.

    sincerely, gpapp

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,594
    Login to Give a bone
    0

    Default Re: What is procedure for setting Plot Offset?

    I'm not sure, since I never plot that way. I always plot a view. Post a problem dwg.
    C:> ED WORKING....

  5. #5
    Member
    Join Date
    2006-09
    Posts
    30
    Login to Give a bone
    0

    Default Re: What is procedure for setting Plot Offset?

    Maybe you should import and then assign a page setup from a different dwg just prior to printing.

    I have a buttons that import all of our different page setups. The button macro is this:
    (requires the layout to be active that you want to assign the page setup)

    ^C^C^P_Expert 2 _-psetupin "V:/CAD_Standards/Office_Locations/Minneapolis/Plotters/Page Setups/Mpls-Pagesetup-Templates.dwg" "11x17-Mpls-Template" _Expert 0 (command "-plot" "_N" (getvar"ctab") "11x17-Mpls-Template" "" "_N" "_Y" "_N") ^C^C

    The expert setting stops the get file dialog from appearing when the command is run via LISP command. " -psetupin" is not covered anywhere in the VBA object model, rather all the components of a page setup are. You will have to change the file path and page setup name in the code to what you have. We store all the page setups for one office location in one central drawing.

    Maybe do a sendcommand. This gets ugly, but here is a function I just wrote that accomplishes it. (Requires the layout to be active that you want to assign the page setup)

    Code:
    Function setPsetup(pSetupName As String, pSetupFile As String)
    Dim sCommand As String
    Dim qm As String
    'Dim psetupName As String
    'Dim pSetupFile As String
    'pSetupName = "11x17-Mpls-Template"
    'pSetupFile = "V:/CAD_Standards/UEI/Office_Locations/Minneapolis/Plotters/Page Setups/Mpls-Pagesetup-Templates.dwg"
    qm = """"
    ThisDrawing.SetVariable "EXPERT", 2
    sCommand = "(command " & qm & "_-psetupin" & qm & ")" & vbCr & _
    pSetupFile & vbCr & _
    pSetupName & vbCr & _
    "(command " & qm & "-plot" & qm & " " & qm & "_N" & qm & _
    " (getvar" & qm & "ctab" & qm & ") " & qm & "11x17-Mpls-Template" & _
    qm & " " & qm & qm & " " & qm & "_N" & qm & " " & qm & "_Y" & qm & _
    " " & qm & "_N" & qm & ")" & vbCr
    ThisDrawing.SendCommand sCommand
    ThisDrawing.SetVariable "EXPERT", 0
    DoEvents
    End Function
    I would recommend not having spaces in the paths or setupnames as rule of thumb, as it can be used in more macro types much easier then.

  6. #6
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: What is procedure for setting Plot Offset?

    Why, in the world, are you not plotting by Layout, rather than Display?
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

Similar Threads

  1. Capable of setting dimension on Offset.
    By Wish List System in forum Inventor Wish List
    Replies: 0
    Last Post: 2012-11-14, 02:44 PM
  2. Standard Offset Setting
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2012-08-07, 05:43 PM
  3. setting offset distance
    By ray salmon in forum Revit Architecture - General
    Replies: 3
    Last Post: 2008-06-06, 08:17 PM
  4. Setting plot window in plot preview
    By IanR in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2006-04-18, 07:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •