set layout current via objectDBX

Discussion in 'AutoCAD' started by Jason Piercey, Jan 26, 2005.

  1. Is there a way via objectDBX to set a layout current?

    I aksed about this a while back and was just wondering
    if anything has changed since then.

    http://tinyurl.com/6yodp


    Things I have tried that do not work:

    vla-delete the unwanted layouts from the layout collection

    vla-put-activelayout

    vla-delete the unwanted layouts from the block collection
     
    Jason Piercey, Jan 26, 2005
    #1
  2. Jason Piercey

    James Buzbee Guest

    Seeing how the Active* properties are only relevent in Documents residing in
    the current Acad's Documents collection I don't think there would be such a
    thing as an 'ActiveLayout. I havn't tried with respect to layouts, mind
    you, but I wanted to use the 'ActiveDimstyle to store the office standard
    dimstyle. There is no ActiveDimstyle in a databases opened via ObjectDBX.

    If I'm wrong, Tony or some other extremely intelligent individual will chime
    in soon. ;-)

    jb
     
    James Buzbee, Jan 26, 2005
    #2
  3. Jason Piercey

    Kelie Guest

    Jason,

    I tried these more than once with no luck either and I agree with James. But
    apparently Tony T. had a solution using his AcadX.

    I'm wondering but exactly you want to acheive by setting the active layout
    in document opened via objectdbx. Maybe you can store the desired active
    layout name in a xdata and attach it to layer "0", or store in a xrecord.
    Then in your startup routines, write couple of line to check if such
    xdata/xrecords exist. If so, switch to that layout. Same concept applicable
    to active dimstyle, active textstyle, etc..
     
    Kelie, Jan 26, 2005
    #3
  4. Thanks for the confirmation, just surprises me
    that there is (still) not a way to manipulate a
    layout via objectDbx.
     
    Jason Piercey, Jan 26, 2005
    #4
  5. Kelie,

    I don't use Tony's AcadX.arx, and since it isn't
    available anymore doesn't have much relevance
    here (unfortunately).

    As to why I need to set a layout active via DBX,
    we have a client that is still nursing R14 and we
    must save files down to that version for them to
    review/coordinate with us.

    I am using multiple tabs in these drawings so each
    tab must be set current and saved as it's own file
    before converting to R14. I've got working code
    to save the files as each layout name but I need a
    way to make the correct layouts current so when
    the client opens the files they have what they need.

    Sure, I could do this with a script or some-such
    thing but would rather stick with not opening the
    files in the editor if at all possible.

    Any layout that is not current is ignored when opened
    with R14. Once I have the files saved and the layouts
    set, I'll run the batch converter on the entire set to
    finish things up.


    PS: Why batch converter? Trying to saveas a different
    file format via DBX (R14 or otherwise) crashes here,
    so I just omit that argument and let the batch converter
    take care of it.
     
    Jason Piercey, Jan 26, 2005
    #5
  6. Jason Piercey

    Doug Broad Guest

    Have you tried setting the *paperspace block to the layout block?
     
    Doug Broad, Jan 27, 2005
    #6
  7. Hi Doug,

    Not sure I understand what you are suggesting.
    Could you explain a little more?
     
    Jason Piercey, Jan 27, 2005
    #7
  8. Jason Piercey

    James Buzbee Guest

    Interesting, but both the Layout property for the Block and the Block
    property for the Layout are read only when accessed via ObjectDBX. I don't
    think you could even add either and get around the read only property.

    ; IAcadPaperSpace2: A special Block object containing all the entities in
    the active paper space layout
    ; Property values:
    ; Application (RO) = Exception occurred
    ; Count (RO) = 3
    ; Document (RO) = #<VLA-OBJECT IAxDbDocument 09628db8>
    ; Handle (RO) = "1B"
    ; HasExtensionDictionary (RO) = 0
    ; IsLayout (RO) = -1
    ; IsXRef (RO) = 0
    ; Layout (RO) = #<VLA-OBJECT IAcadLayout 09635474>
    ; Name = "*Paper_Space"
    ; ObjectID (RO) = 2127998168
    ; ObjectName (RO) = "AcDbBlockTableRecord"
    ; Origin = (0.0 0.0 0.0)
    ; OwnerID (RO) = 2127997960
    ; XRefDatabase (RO) = AutoCAD.Application: No database

    ; IAcadLayout: The plot settings and visual properties of a model space or
    paper space block
    ; Property values:
    ; Application (RO) = Exception occurred
    ; Block (RO) = #<VLA-OBJECT IAcadPaperSpace2 09635704>
    ; CanonicalMediaName = "Letter_(8.50_x_11.00_Inches)"
    ; CenterPlot = 0
    ; ConfigName = "None"
    ; Document (RO) = #<VLA-OBJECT IAxDbDocument 09628db8>
    ; . . .
     
    James Buzbee, Jan 27, 2005
    #8
  9. What release of AutoCAD are you using?
     
    Tony Tanzillo, Jan 27, 2005
    #9
  10. 2005
     
    Jason Piercey, Jan 27, 2005
    #10
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.