Results 1 to 4 of 4

Thread: acSelectionSetAll and line selections

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2009-07
    Posts
    1

    Default acSelectionSetAll and line selections

    I am having a problem with my code selecting more than what is specified by the filterdata, example below. I have a drawing with hidden attributes(text) in modelspace and the drawing in paperspace, but my selectionset is till finding the entities in modelspace.

    Does anyone have a suggestion?

    Code:
    Set acSSet2 = ThisDrawing.SelectionSets.Add("ALL")
    ReDim Preserve HasEnts(LayOuts.Count)
    a = 0
    For Each layout In ThisDrawing.LayOuts
        whatlayout = layout.Name
        wSpace = layout.Block.Name
        If wSpace = "*Paper_Space" Or wSpace Like "*PAPER_SPACE" Then
           ThisDrawing.ActiveSpace = acPaperSpace
        Else
            ThisDrawing.ActiveSpace = acModelSpace
        End If
        'ThisDrawing.ActiveLayout = layout
        iMode2 = acSelectionSetAll
        iFilterType2(0) = 0
        vFilterData2(0) = "Line"
        acSSet2.Select iMode2, , , iFilterType2, vFilterData2
        iCount = acSSet2.Count
        If iCount > 17 Then
            HasEnts(a) = layout.Name
            a = a + 1
        Else
            HasEnts(a) = layout.Name
            a = a + 1
        End If
    Next
    Last edited by Ed Jobe; 2010-01-19 at 06:02 PM. Reason: Added Code tags.

  2. #2
    Active Member
    Join Date
    2007-07
    Posts
    85

    Default Re: acSelectionSetAll and line selections

    Perhaps this part of your code is including modelspace before you make your selelctionset:

    Code:
      Else
            ThisDrawing.ActiveSpace = acModelSpace

  3. #3
    Forum Manager, Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    4,777

    Default Re: acSelectionSetAll and line selections

    Quote Originally Posted by darfnuggi View Post
    Perhaps this part of your code is including modelspace before you make your selelctionset:

    Code:
      Else
            ThisDrawing.ActiveSpace = acModelSpace
    No, that wouldn't be it. The enum acSelectionSetAll specifies ALL objects in the dwg, not just the current layout. To exclude ms ents, include group code 67 =1 in your filter. To get ents on a single ps layout, you could bypass the ss method and just iterate the ents in the Layout's Block property.
    C:> ED WORKING....

  4. #4
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    482

    Default Re: acSelectionSetAll and line selections

    add this to your code

    Code:
    iFilterType2(1) = 67
    vFilterData2(1) = 1
    this will get the data in all layout but not modelspace

    dxf code 67
    Absent or zero indicates entity is in model space. 1 indicates entity is in paper space (optional).

    note: you will need to redim iFilterType and vFilterData2
    Note:
    update to 2011
    I am using ADT 2007 08/06/2008

    PS. If you use any Code I post or Down Load Attachment I would like to know if it was helpful. So please post reply to this thread, on how you use the code or down load. Thank You

Similar Threads

  1. Cycle through selections
    By Mater in forum AutoLISP
    Replies: 11
    Last Post: 2011-06-24, 05:08 PM
  2. Selections
    By jbervel in forum Robot Structural Analysis
    Replies: 1
    Last Post: 2010-05-06, 04:20 PM
  3. API Selections
    By justsagar in forum NavisWorks - General
    Replies: 8
    Last Post: 2010-01-25, 06:02 AM
  4. Sheet Selections
    By Opie in forum AutoCAD Sheet Set Manager
    Replies: 3
    Last Post: 2005-10-31, 11:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •