Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross 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
Oct 15, 2009
154
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

Top