Find the Page Setups that are createt in each Layout ?

Discussion in 'AutoCAD' started by Ivo Daum, Jul 15, 2004.

  1. Ivo Daum

    Ivo Daum Guest

    Hallo NG,
    I have 2 dropdownlists in VB, in the first all layouts of the drawing.
    I want, if i click one layout of this list the 2nd dropdownlist will add all
    page setups (name), which are createt in this layout.
    Like the displayed in the top right of the plot dialogue box.
    The are the page setups shown with *pagesetupname if the not from the active
    Layout.

    Plase help,
    thanks
    Ivo
     
    Ivo Daum, Jul 15, 2004
    #1
  2. Ivo Daum

    Dragnsbld Guest

    start with this and work your way through to get what you want.

    Dim PlCon As AcadPlotConfiguration
    Dim PlCons As AcadPlotConfigurations

    Set PlCons = ThisDrawing.PlotConfigurations

    If PlCons.Count = 0 Then
    Exit Sub
    End If

    For Each PlCon In PlCons
    Debug.Print PlCon.Name
    Next
     
    Dragnsbld, Jul 15, 2004
    #2
  3. Ivo Daum

    TomD Guest

    I think you would have to use the CopyFrom method of the layout. I use the
    following to get all pagesetups, and if I remember correctly, it does not
    retrieve the *pagesetups.

    Function GetPageSetups() As Variant
    'Returns variant array containing PaperSpace Layout names
    Dim oPCs As AcadPlotConfigurations, oPc As AcadPlotConfiguration
    Dim vRet() As Variant, vUb As Variant
    Set oPCs = ThisDrawing.PlotConfigurations
    For Each oPc In oPCs
    On Error Resume Next: vUb = UBound(vRet): On Error GoTo 0
    If IsEmpty(vUb) Then ReDim vRet(0) Else ReDim Preserve vRet(UBound(vRet)
    + 1)
    vRet(UBound(vRet)) = oPc.Name
    Next oPc
    Set oPc = Nothing: Set oPCs = Nothing
    GetPageSetups = vRet
    End Function
     
    TomD, Jul 15, 2004
    #3
  4. Ivo Daum

    Ivo Daum Guest

    Thanks for the Code, but so i get all pagesetupnames of the compleat
    drawing,
    what i want is the pagesetupnames of the Layout which was activ when they
    are createt.
    I want the same list like in the plot-dialog-box in the right up corner,

    Ivo
     
    Ivo Daum, Jul 15, 2004
    #4
  5. Ivo Daum

    TomD Guest

    Ohhhh........now I understand. I don't know if there is an easier way, but
    I would get each Layout's individually by using the CopyFrom method.

    Something like:

    For Each oLayout in ThisDrawing.Layouts
    Set oPC = oLayout.CopyFrom
    'Add oPC to a collection
    Next oLayout

    Then process the collection when you're finished.

    If there is a better way, someone help me out here.........lol. (The above
    is how I would approach it, just from what I know.)
     
    TomD, Jul 15, 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.