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!

product name and part number from multiselection

Status
Not open for further replies.

iscariot

Mechanical
Joined
Oct 15, 2009
Messages
154
Location
DE
I would like to select some products and get their names and part number.
I found how to do it for first selected product, but I need to select many products at once:
Code:
Sub CATMain()
    ' Retrieve the selected component
    Dim oSelection As Selection
    Set oSelection = CATIA.ActiveDocument.Selection
    Dim oProduct As AnyObject
    On Error Resume Next
    Set oProduct = oSelection.FindObject("CATIAProduct")
    If (Err.Number <> 0) Then
        MsgBox "No selected product"
    Else
        On Error Goto 0

        ' Read information on the component
        Dim sTextString As String
        sTextString = oProduct.Name & " / " & oProduct.PartNumber
	msgbox sTextString
    End If
End Sub

How can I do achieve this?




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top