Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Activate Main Top Node product in assembly

Status
Not open for further replies.

NaWin55

Mechanical
Mar 21, 2020
97
0
0
IN
Hello all

i am trying to create a macro to activate top main product of a assembly

i tried Product.Activate didnt work
catia.startcommand "frmActivate"
didnt work
is there any way

when i run the macro the mainproduc1 should be in Blue color means that is the active editing product in tree
refer image
image_q1oomi.jpg
 
Replies continue below

Recommended for you

you need to select the node first, and then use the StartCommand.


Code:
Sub CATMain()
Dim myDoc
Set myDoc = CATIA.ActiveDocument
Dim Selection1 As Selection
Set Selection1 = myDoc.Selection

Selection1.Add myDoc.Product
CATIA.StartCommand "FrmActivate"
End Sub

regards,
LWolf
 
Status
Not open for further replies.
Back
Top