See the top rated post in this thread. Click here

Results 1 to 5 of 5

Thread: vla-GetSubSelection has anyone used this?

  1. #1
    Active Member
    Join Date
    2015-12
    Location
    Utah
    Posts
    69
    Login to Give a bone
    0

    Default vla-GetSubSelection has anyone used this?

    From the 2006 help files:

    Returns the row and column indexes of the cells in a subselection set.

    See Also | Example

    Signature

    object.GetSubSelection(rowMin, rowMax, colMin, colMax)

    Object

    Table
    The object or objects this method applies to.

    rowMin

    Long; zero-based minimum row index for the subselection set of cells in the table

    rowMax

    Long; zero-based maximum row index for the subselection set of cells in the table

    colMin

    Long; zero-based minimum column index for the subselection set of cells in the table

    colMax

    Long; zero-based maximum column index for the subselection set of cells in the table

    Remarks

    This method gets the row and column indices of the cells in the subselection set. The total number of selected cells is equal to (rowMax - rowMin + 1) * (colMax - colMin + 1)

    Note that the example link points to code for adding a table, but doesn't say anything about this method

    I'm getting the following when I try this:

    temp
    (#<VLA-OBJECT IAcadTable2 1269a4d4> (57 4) (41 1))
    _2$ (setq temp2 (vla-getsubselection (car temp) 41 57 1 4))
    ; error: Automation Error. Description was not provided.
    _3$

    Any suggestions welcome
    Mike Weaver

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: vla-GetSubSelection has anyone used this?

    What are you trying to do?

    The only way I could get it to work is to set it first, then grab them. So it seems like it is pretty useless unless they are set by something else. To get them this is what I used.
    Command: (vla-GetSubSelection ob2 'a 'b 'c 'd)
    nil

    Command: !a
    0

    Command: !b
    2

    Command: !c
    0

    Command: !d
    2
    As this didn't work for some reason.
    Command: (vlax-invoke ob2 'GetSubSelection 'a 'b 'c 'd)

    nil

    Command: !a
    nil

    Command: !b
    nil

    Command: !c
    nil

    Command: !d
    nil
    And I set them like
    Command: (vlax-invoke ob2 'SetSubSelection 0 2 0 2)
    nil
    This is the error I was getting when trying to 'get before I 'set.
    Command: (VLA-GETSUBSELECTION OB2 'RWMN 'RWMX 'CLMN 'CLMX)
    ; error: Automation Error. Description was not provided.

    Command: (vlax-invoke ob2 'GetSubSelection 'a 'b 'c 'd)
    ; error: Exception occurred

  3. #3
    Active Member
    Join Date
    2015-12
    Location
    Utah
    Posts
    69
    Login to Give a bone
    0

    Default Re: vla-GetSubSelection has anyone used this?

    Quote Originally Posted by T.Willey View Post
    What are you trying to do?

    The only way I could get it to work is to set it first, then grab them. So it seems like it is pretty useless unless they are set by something else. To get them this is what I used.

    As this didn't work for some reason.

    And I set them like

    This is the error I was getting when trying to 'get before I 'set.
    I'm trying to set a selection region and have it highlight to show the selection. If I manually select a region I can use GetSubSelection to find out what has been selected. If I use SetSubSelection to select a region I can find out what that region is with GetSubSelection (but I already know since I just set it). But I don't see a way to show the user what has been selected

    Thanks for the help, Tim.

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    1

    Default Re: vla-GetSubSelection has anyone used this?

    In 2008, SetSubSelection does highlight the specified region. So it was fixed at some point.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    Active Member
    Join Date
    2015-12
    Location
    Utah
    Posts
    69
    Login to Give a bone
    0

    Default Re: vla-GetSubSelection has anyone used this?

    Quote Originally Posted by RobertB View Post
    In 2008, SetSubSelection does highlight the specified region. So it was fixed at some point.
    Cool! Waiting impatiently for 2008

Posting Permissions

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