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 TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get the "Part Number" in Product? not "Instance name"

Status
Not open for further replies.

tpalsl125

Automotive
Joined
Apr 24, 2015
Messages
44
Location
DE
Hello all,

I found this script on here site.

But this can get only Instance name.

For example, I have 3 plates in a prodcut.

If that plate name is "Plate", instance name will be "Plate.1", "Plate.2", "Plate.3".

How can I modify this scrpt to get the "Part Number" not the "Instance name"?

Code:
Language="VBSCRIPT"

Sub CATMain()
 Set Document = CATIA.ActiveDocument 
 Set Selection = Document.Selection

MsgBox "Select Part, Product or Component"

               ReDim InputObjectType(0) : InputObjectType(0)="Product" 
               Status=Selection.SelectElement2(InputObjectType,"Select Part, Product or Component",true)
               if (Status = "Cancel") then Exit Sub
               msgbox selection.item(1).value.name
End Sub
 
[...]
msgbox selection.item(1).value.PartNumber
[...]


Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top