Importing Page Setups

Discussion in 'AutoCAD' started by James Wedding, Nov 11, 2004.

  1. I just realized that there's no nice easy Import method on the
    PlotConfigurations collection. Anyone have a good way to get Pagesetups into
    the current dwg from a dwt that they would share? Thank you.

    --
    James Wedding, P.E.
    IT Manager
    Jones & Boyd, Inc.
    Dallas, TX
    XP/2 on P4-3.4/1G
    LDT2005+C3D
    http://au.autodesk.com
    Sign up now for AU2004!
     
    James Wedding, Nov 11, 2004
    #1
  2. James Wedding

    Bill Debevc Guest

    here is how I do it. sorry its lisp.

    (defun c:pageSetup30x42 ()
    (setq cmdeko (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (setq emode (getvar "EXPERT"))(setvar "EXPERT" 2)
    (setq filepath "k:/cad standards/templates/friedmutter group sheet
    30x42.dwt")
    (command "filedia" "0")
    (setq setups "DWF 30x42,Xerox 8855 30x42 Half Side (thin),Xerox 8855
    30x42,Xerox 8855 30x42 Half Size,Xerox 8855 30x42 Vellum,PDF 30x42")
    (command "-psetupin" filepath setups)
    (setvar "Expert" emode)
    (setvar "cmdecho" cmdeko)
    (princ)
    )

    Bill Debevc
     
    Bill Debevc, Nov 11, 2004
    #2
  3. Thanks.

    Just FYI, you can replace the list of pagesetups with a * and it imports
    them all.

    --
    James Wedding, P.E.
    IT Manager
    Jones & Boyd, Inc.
    Dallas, TX
    XP/2 on P4-3.4/1G
    LDT2005+C3D
    http://au.autodesk.com
    Sign up now for AU2004!
     
    James Wedding, Nov 11, 2004
    #3
  4. James Wedding

    Jeff Mishler Guest

    OK, nevermind......I didn't test this enough. It brings the name in just
    fine, but selecting it in the Page Setup/Plot dialog gives an
    error......working out why now.
     
    Jeff Mishler, Nov 11, 2004
    #4
  5. James Wedding

    Jeff Mishler Guest

    Found it.....replace the CommandButton1_Click code with this:
    Code:
    Private Sub CommandButton1_Click()
    Dim I As Integer
    Dim oCfgNew As AcadPlotConfiguration
    Dim oCfg As AcadPlotConfiguration
    
    
    With ListBox2
    For I = 0 To .ListCount - 1
    If .Selected(I) = True Then
    On Error Resume Next
    Set oCfgNew = ThisDrawing.PlotConfigurations.Item(.List(I, 0))
    If Err.Number <> 0 Then
    Set oCfgNew = ThisDrawing.PlotConfigurations.Add(.List(I,
    0))
    End If
    Err.Clear
    On Error GoTo 0
    Set oCfg = oDBX.PlotConfigurations.Item(.List(I, 0))
    oCfgNew.CopyFrom oCfg
    End If
    Next
    End With
    
    End Sub
    
     
    Jeff Mishler, Nov 11, 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.