How to: Determine if viewobject is a modelspace or paperspace view?

Discussion in 'AutoCAD' started by Erik Droog, Jun 2, 2004.

  1. Erik Droog

    Erik Droog Guest

    Hi

    I want to figure out if a view is made in modelspace or in paperspace.

    Does anyone has an idea how?

    TIA

    Erik
     
    Erik Droog, Jun 2, 2004
    #1
  2. Erik Droog

    Joe Sutphin Guest

    I believe the OwnerID property of the View object holds this info for you.
    Compare it to the ModelSpace and PaperSpace ObjectIDs to determine which
    space the object resides. HTH.

    Joe
     
    Joe Sutphin, Jun 2, 2004
    #2
  3. Unless you are using 2005, then access the view thru IAcadView2 and read
    the LayoutId property

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jun 2, 2004
    #3
  4. Erik Droog

    Kerry Brown Guest

    I will watch this with baited breath ..
    I thought the Views Collection owned the Views, and there was no way
    using the VBA Object Model to determine which 'Space' had the view.

    This works in VLisp, but that probably won't interest you :
    (setq view_name "Section_A")
    (setq viewbit (cdr (assoc 70 (tblsearch "view" view_name))))
    which returns an integer to reflect the VIEW space location and/or xref
    info.

    regards.Kerry
    ==============================================================
    I believe the OwnerID property of the View object holds this info for
    you.
    Compare it to the ModelSpace and PaperSpace ObjectIDs to determine which
    space the object resides. HTH.

    Joe
     
    Kerry Brown, Jun 2, 2004
    #4
  5. Tony Tanzillo, Jun 2, 2004
    #5
  6. Erik Droog

    Joe Sutphin Guest

    Joe Sutphin, Jun 3, 2004
    #6
  7. The only thing that jumps out at me is it appears bit
    0 (value 1) in the dxf data group 70 is set when the
    view is in paperspace, otherwise it is clear.
     
    michael puckett, Jun 3, 2004
    #7
  8. Tony Tanzillo, Jun 3, 2004
    #8
  9. Erik Droog

    Joe Sutphin Guest

    OK, so next time when you have something to say, please make it useful.
    Otherwise, keep you comments to yourself!

    Joe
    --
     
    Joe Sutphin, Jun 5, 2004
    #9
  10. Excuse me but you posted an answer that was incorrect. All Tony did was correct you and you have a go at him.
    Regards - Nathan
     
    Nathan Taylor, Jun 7, 2004
    #10
  11. "Joe Sutphin"
    It was useful.

    It prevented someone from wasting their time
    following your bad advice.

    That fact that it annoys you is purely coincidental.

    --
    http://www.caddzone.com

    AutoCAD based Security Planning Solutions:
    http://www.caddzone.com/securityplanning

    AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
    http://www.acadxtabs.com
     
    Tony Tanzillo, Jun 7, 2004
    #11
  12. Erik Droog

    Erik Droog Guest

    I tried to get the views from the drawing with the code below.

    Why isn't this working?

    Dim gpCode(1) As Integer
    Dim dataValue(1) As Variant
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("SSET1")

    gpCode(0) = 0
    dataValue(0) = "TABLE"
    gpCode(1) = 2
    dataValue(1) = "VIEW"
    ssetObj.Select acSelectionSetAll, , , gpCode, dataValue
     
    Erik Droog, Jul 21, 2004
    #12
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.