Results 1 to 4 of 4

Thread: VBA and SelectionSets

  1. #1
    I could stop if I wanted to
    Join Date
    2003-03
    Location
    Alberta
    Posts
    260
    Login to Give a bone
    0

    Default VBA and SelectionSets

    I have a sub routine that used a selection set with a filter to select all the hatches in a drawing. Or so I thought. It seams to give different results if the zoom window is changed. If I am zoomed extents everything works as it should. If I am zoomed in on an area it doesn't seem to grab all the hatches in the drawing. Could I be doing something wrong with my selection set definition or the filter definition?

  2. #2
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Default Re: VBA and SelectionSets

    Hi,
    You may find some help in this thread. If not, post your code here.

  3. #3
    I could stop if I wanted to
    Join Date
    2003-03
    Location
    Alberta
    Posts
    260
    Login to Give a bone
    0

    Default Re: VBA and SelectionSets

    My code goes something like this....

    ' Define filter.
    aFilterType(0) = 0
    aFilterData(0) = "Hatch"
    aFilterType(1) = 8
    aFilterData(1) = "access-label_msk"

    ' Code for selection set creation....
    ' Create a selection set using a given name.
    ' If the selection set name is already used, use that selection set.
    ' Clear the selection set before use.

    ' Add items to the selection set based on the filter data.
    oSelect(0).Select acSelectionSetAll, , , aFilterType, aFilterData

    When I use Count to see how many objects where selected I get a different number depending on where I am zoomed in on the drawing. If I am zoomed extents I get the value I expect but if I am zoomed in on a part of the drawing the count is different. Why does this happen, shouldn't it select the same objects no matter what part of the drawing the user is looking at?

  4. #4
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: VBA and SelectionSets

    I'm going to venture a guess that there is something else going on in your code. acSelectionSetAll will get ALL occurances of an object that matches the filter data whether, or not, it is visible on the screen...including those on frozen and Off layers.

    If you post your code and the drawing, zoomed to where it doesn't work correctly, we may be able to help.

    Jeff

Similar Threads

  1. more flexible selectionsets
    By eliasengin in forum API Wish List
    Replies: 1
    Last Post: 2005-10-17, 11:02 PM

Posting Permissions

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