Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve the active product object 3

Status
Not open for further replies.

USB Memory

Mechanical
Joined
May 28, 2020
Messages
44
Location
JP
Hi all

Does someone know how to retrieve the active product object?
Active product means that the product is in editing.

for example.
Red circle product is in editing (active product) bellow.
Sample1_srs8td.png


I know there is activedocument Property but the property gives only top product document.
 
Code:
Dim sel: set sel = CATIA.ActiveDocument.Selection
sel.Clear
sel.Search "CATAsmSearch.Product,in"
Dim activeProduct: set activeProduct = sel.Item(1).LeafProduct
sel.Clear
 
I do not understand this very well.....Why don't you just double-click on the product you want to activate/edit?....

CAD 2015
 
Thank you, Little Cthulhu.
I did well as you mentioned.
Is the product object definitely put in item(1)?
As far as I Checked, item(1) has the active product but other items don't have it.

Thanks
 
Thank you, CAD2015
Is it possible to retrieve the active product "object" by double-click on the product?
If it is possible, I would like to know the way as well.

Thanks
 
Thank you, ferdo

I watched the link you attached but it is not working as my image
Little Cthulhu's solution perfectly match what i want to do.

 
Is the product object definitely put in item(1)?

Yes, it is when ",in" scope is used (meaning "search inside of UI-active product").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top