PDA

View Full Version : vla-GetSubSelection has anyone used this?


mweaver
2007-10-17, 12:12 AM
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

T.Willey
2007-10-17, 01:09 AM
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

mweaver
2007-10-17, 04:57 AM
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.

RobertB
2007-10-17, 06:57 PM
In 2008, SetSubSelection does highlight the specified region. So it was fixed at some point.

mweaver
2007-10-17, 08:53 PM
In 2008, SetSubSelection does highlight the specified region. So it was fixed at some point.

Cool! Waiting impatiently for 2008