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 activate the sheet to which the selected view belongs?

Status
Not open for further replies.

Mirme.lee

Aerospace
Joined
Jul 18, 2024
Messages
4
Location
KR
Catia Drawing..

What is the VBA Code that activates the sheet to which the selected view belongs? I plan to use the selection function to select the view.
 
Hi,

I think that the sheet is allready activated if you have selected a view.

Here the code to retrieve the sheet name:

Code:
Sub CATMain()

Dim Document1 As Document
Set Document1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = Document1.Selection

Set myview = selection1.Item(1).Value
Set mysheet = myview.Parent.Name

End Sub

Regards
Marc
 
CATIA.ActiveDocument.Selection.Item(1).Value.Parent.Parent.Activate
 
Thank you all.
Thanks to you, my work has become easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top