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!

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

Status
Not open for further replies.

tpalsl125

Automotive
Apr 24, 2015
44
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
 
Replies continue below

Recommended for you

[...]
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

Top