Read Iprops from selected occurence in browser

Read Iprops from selected occurence in browser

Anonymous
Not applicable
464 Views
1 Reply
Message 1 of 2

Read Iprops from selected occurence in browser

Anonymous
Not applicable

Hi to all,

is there a way to read the iprops from the selected occurrence in the browser pane (assembly and drawing)?

Would like to:

1. manually select occurrence in the browser

2. start macro with keyboard shortcut

3. read iprops of selected occurrence

4. copy iprop to clipboard

 

Would love some help - if anyone has such a code available - would greatly appreciate a copy?

 

Thanks

Alex

0 Likes
Accepted solutions (1)
465 Views
1 Reply
Reply (1)
Message 2 of 2

Ralf_Krieg
Advisor
Advisor
Accepted solution

 

 

In an assembly, you should first check if your Document.SelectSet contains a ComponentOccurrence (and not e.g. a Workplane). If so you can traverse through ComponentOccurrence.Definition.Document.PropertySets to the Property you want.

 

In a drawing a selected browsernode returns only a generic object. The only way I can think of, is to recursive traverse through DrawingDocument.BrowserPanes.ActivePane.TopNode.BrowserNodes and search for the node with Selected=True propertie. This node has a NativeObject property containing the ComponentOccurrence. If you got it, you can go on with the assembly method above.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes