kGenericObject in selectset question (IV10), selecting components in Drawing Browser

kGenericObject in selectset question (IV10), selecting components in Drawing Browser

Anonymous
Not applicable
474 Views
4 Replies
Message 1 of 5

kGenericObject in selectset question (IV10), selecting components in Drawing Browser

Anonymous
Not applicable
Is there currently anyway to get from a kGenericObject type
(or IRxGenericObject) to the underlying REAL object? The
object browser only lists "Type" as the only object member
which doesn't do real good.

If not, is there an easy way to get the name of the currently
selected component from the BrowserPane (in a drawing)?
(without having to iterate every node of the browserpane
checking for selected nodes!)

TIA,
Bob S.
0 Likes
475 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Bob,

Pass in the GenericObject as the first argument to
DrawingDocument.ProcessViewSelection method. This method returns the
DrawingView to which the selection belongs as well as the object. The
returned object is really the corresponding object in the model (a
ComponentOccurrence from the referenced assembly, for instance). Please
note, however, that not all selection types are supported (I believe the
method currently only supports a Document, a ComponentOccurrence or a
PartFeature).

Sanjay-


"Bob S." wrote in message
news:4926071@discussion.autodesk.com...
Is there currently anyway to get from a kGenericObject type
(or IRxGenericObject) to the underlying REAL object? The
object browser only lists "Type" as the only object member
which doesn't do real good.

If not, is there an easy way to get the name of the currently
selected component from the BrowserPane (in a drawing)?
(without having to iterate every node of the browserpane
checking for selected nodes!)

TIA,
Bob S.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Sanjay,

Thanks for the pointer. I will give it a try as soon as I overcome my latest
hurdle on my current macro writing.

Bob S.

"Sanjay Ramaswamy (Autodesk)" wrote in message news:4926262@discussion.autodesk.com...
Bob,

Pass in the GenericObject as the first argument to
DrawingDocument.ProcessViewSelection method. This method returns the
DrawingView to which the selection belongs as well as the object. The
returned object is really the corresponding object in the model (a
ComponentOccurrence from the referenced assembly, for instance). Please
note, however, that not all selection types are supported (I believe the
method currently only supports a Document, a ComponentOccurrence or a
PartFeature).

Sanjay-


"Bob S." wrote in message
news:4926071@discussion.autodesk.com...
Is there currently anyway to get from a kGenericObject type
(or IRxGenericObject) to the underlying REAL object? The
object browser only lists "Type" as the only object member
which doesn't do real good.

If not, is there an easy way to get the name of the currently
selected component from the BrowserPane (in a drawing)?
(without having to iterate every node of the browserpane
checking for selected nodes!)

TIA,
Bob S.
0 Likes
Message 4 of 5

Anonymous
Not applicable
Sanjay,

I implemented your suggestion to use ProcessViewSelection method
and it works like a charm. Thanks again!

Bob S.

"Sanjay Ramaswamy (Autodesk)" wrote in message news:4926262@discussion.autodesk.com...
Bob,

Pass in the GenericObject as the first argument to
DrawingDocument.ProcessViewSelection method. This method returns the
DrawingView to which the selection belongs as well as the object. The
returned object is really the corresponding object in the model (a
ComponentOccurrence from the referenced assembly, for instance). Please
note, however, that not all selection types are supported (I believe the
method currently only supports a Document, a ComponentOccurrence or a
PartFeature).

Sanjay-


"Bob S." wrote in message
news:4926071@discussion.autodesk.com...
Is there currently anyway to get from a kGenericObject type
(or IRxGenericObject) to the underlying REAL object? The
object browser only lists "Type" as the only object member
which doesn't do real good.

If not, is there an easy way to get the name of the currently
selected component from the BrowserPane (in a drawing)?
(without having to iterate every node of the browserpane
checking for selected nodes!)

TIA,
Bob S.
0 Likes
Message 5 of 5

Anonymous
Not applicable
I took the liberty of testing the ability of ProcessViewSelection in my
current drawing and it correctly returned the following types:
'IRxComponentOccurence + IRxComponentOccurenceProxy ok
'IRxRevolveFeature good.
'IRxChanferFeature good.
'IRxExtrudeFeature good.
'IRxNonParametricBaseFeature good.
'IRxHoleFeature ok
'IRxShellFeature ok
'IRxFilletFeature ok
'IRxSplitFeature ok
'IRxSweepFeature ok
Since I did not have every part feature type available in my design, I can
only assume it handles the other PartFeatures OK. However, it would
be nice if there was some way to select and get WorkFeatures in this way.
Currently they are not even added to the SelectSet as far as I can tell.
My macro code bombs out on trying to assign oSelectSet.Item(1) to
my Object variable if I have a workpoint or workaxis selected. How
long must I wait to implement my PointDim command? 😉

Bob S.

"Sanjay Ramaswamy (Autodesk)" wrote in message news:4926262@discussion.autodesk.com...
Bob,

Pass in the GenericObject as the first argument to
DrawingDocument.ProcessViewSelection method. This method returns the
DrawingView to which the selection belongs as well as the object. The
returned object is really the corresponding object in the model (a
ComponentOccurrence from the referenced assembly, for instance). Please
note, however, that not all selection types are supported (I believe the
method currently only supports a Document, a ComponentOccurrence or a
PartFeature).

Sanjay-


"Bob S." wrote in message
news:4926071@discussion.autodesk.com...
Is there currently anyway to get from a kGenericObject type
(or IRxGenericObject) to the underlying REAL object? The
object browser only lists "Type" as the only object member
which doesn't do real good.

If not, is there an easy way to get the name of the currently
selected component from the BrowserPane (in a drawing)?
(without having to iterate every node of the browserpane
checking for selected nodes!)

TIA,
Bob S.
0 Likes