MKEdits
Mechanical
- Jan 9, 2023
- 31
Hello guys, I just got into macro writting in VBScript and i got requested to prepare macro which checks if particular sketch was published and if it has proper name (if possibly change color of notpublished sketch / wrong named publication). It all happens in product assembly which includes many subproducts with parts in it. As i did research i couldn't find exact way to automatize it, i've found many macros which can delete not linked publications but those are not what im looking for.
Everything should happen after:
If (intRC = vbYes) Then
Dim productDocument1
Set productDocument1 = CATIA.ActiveDocument
Dim partDocument1
Dim selection1
Set selection1 = productDocument1.Selection
Dim InputObjectType(0)
InputObjectType(0) = "Product"
status= selection1.SelectElement3(InputObjectType, "Choose console", False, CATMultiSelectionMode.CATMultiSelTriggWhenUserValidatesSelection, False)
Dim selected_object
Set selected_object = selection1.Item(1).Value
Everything should happen after:
If (intRC = vbYes) Then
Dim productDocument1
Set productDocument1 = CATIA.ActiveDocument
Dim partDocument1
Dim selection1
Set selection1 = productDocument1.Selection
Dim InputObjectType(0)
InputObjectType(0) = "Product"
status= selection1.SelectElement3(InputObjectType, "Choose console", False, CATMultiSelectionMode.CATMultiSelTriggWhenUserValidatesSelection, False)
Dim selected_object
Set selected_object = selection1.Item(1).Value