get the name of selected harness branch in catia electrical harness

101 views Asked by At

reference imageI am trying to create macro which can show the defected harness branches name in Catia electrical Assy. I tried with below code. but I am getting name as "selction0()". if am adding "selection1.Item(1).Value.Name" it is showing only part number instead of electrical branch name.

Sub CATMain()

Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = productDocument1.Selection

selection1.Search "CATElectricalSearch.Branchable.IsResultOK=FALSE,all"

Dim brnch As String
 brnch = selection1.Name
msgbox brnch

End Sub
0

There are 0 answers