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 MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activate catia document

Status
Not open for further replies.

elmundo777

Automotive
Joined
Jun 23, 2020
Messages
93
Location
BY
Hello. Is there any way to determine the id of the document? or contact by window number?
For example, I have a product where other products and desks are nested. After renaming and saving, the last element of the collection is activated for me. I want to go back later. At the same time, other documents can be opened before this document or after it.
I am attaching a picture:
window_hpqgmb.png


In my case, I save product2. Part1 is active at the end.
How do I reactivate product2 and all its contents?

I write in vb.net / C#.
I tried this option (VB.net language):

Code:
If List_indexes.Count <> 0
   dim firstOrDefault = List_indexes.First()
   Dim first1 = firstOrDefault+1 ' add +1 because list indexes starts from 0, Catia collection from 1
  [b] Catia.Documents.Item(first1).Activate()[/b][u][/u]
End if

But I always get the error. Because "Catia.Documents.Item(first1).Activate()" activates documents from all opened, but not from current document (Product2 in the picture).

Is it possible to somehow remember the active document and then refer to it after all the operations performed?

It does not come out by name, because it is not known whether the user will change the name of the main product or not

Help me please!
 
Code:
Dim originalDocument: set originalDocument = CATIA.ActiveDocument
' do stuff....
originalDocument.Activate

If by some reason you call "active document" actual UI-active object in specification tree then it's a completely different story.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top