Create plot configuration from layout

Discussion in 'AutoCAD' started by johnsonm, Sep 28, 2004.

  1. johnsonm

    johnsonm Guest

    In autocad, you can create a new page setup from an existing layout's page setup. How can this be done in VBA? I've looked at copyfrom, but that only apears to be for copying from plot configurations and not layouts. Any ideas?
     
    johnsonm, Sep 28, 2004
    #1
  2. johnsonm

    Ed Jobe Guest

    Depending upon which help file you are looking at, it may not be correct.
    But, you can use CopyFrom on layouts and PlotConfigs interchangeably.

    --
    ----
    Ed
    ----
    setup. How can this be done in VBA? I've looked at copyfrom, but that only
    apears to be for copying from plot configurations and not layouts. Any
    ideas?
     
    Ed Jobe, Sep 28, 2004
    #2
  3. johnsonm

    SpeedCAD Guest

    Hi...

    You can do it with ObjectDXB.

    First you must know the name of page setup and next copy it.

    'file from ObjectDBX
    dbxApp.Open File

    Set objPlots = dbxApp.PlotConfigurations
    Set objPlot = objPlots.Item(name)

    'from current drawing
    Set objPlotsCurrent = acadDoc.PlotConfigurations
    Set objPlotCurrent = objPlotsCurrent.Add(name)

    'copy page setup
    objPlotCurrent.CopyFrom objPlot

    Set dbxApp = Nothing

    Note:
    If page setup is in Model Space and your drawing is in Paper Space send a error. Is the same reverse...

    Un saludo de SpeedCAD.. :D
    CHILE
    FORO: http://www.hispacad.com/foro
     
    SpeedCAD, Sep 29, 2004
    #3
  4. johnsonm

    Ed Jobe Guest

    You don't need ObjectDbx to do that. You can do it with ThisDrawing as well.
     
    Ed Jobe, Sep 29, 2004
    #4
  5. johnsonm

    SpeedCAD Guest

    Hi Ed Jobe...

    Yes, I know that I don't need ObjectDBX, but with this you can do it invisible :D...

    Un Saludo de SpeedCAD... :D
    CHILE
    FORO: http://www.hispacad.com/foro
     
    SpeedCAD, Sep 29, 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.