Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Override or change 32 digit part number

3 REPLIES 3
Reply
Message 1 of 4
alundr
351 Views, 3 Replies

Override or change 32 digit part number

Does anyone know how to override or change the generated 32 digit part number?  Or have a snipit of code that will do this?

 

Thanks,

Andrew

3 REPLIES 3
Message 2 of 4
AlexKorzun
in reply to: alundr

Hi Andrew,

 

There are several ways to deal with your problem:

1. Simple. Add the "Part Number" entry into iProperties Rule, similar to:

    Rule iProperties As List = {{"Part Number","ABC"}}

 

2. In some cases (you want the Part number to be based on the finalized geometry of the IPT or on some external data), you have to override the GetNewPartNumber(...) Method specified in IvAdoptedPart Design.

Please have a look at PartNumberDemo.iam in the ETO Inventor samples.

Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 3 of 4
alundr
in reply to: AlexKorzun

Thanks.  That did help.  I will have to override the GetNewPartNumber.  That changes the iProperties Part number.  How do I change the File name to match?

Message 4 of 4
Lesoux
in reply to: alundr

Try something like that (add this code to "AdoptedComponents" design):

 

Parameter Rule sPartName As String = ""
Parameter Rule iPartIndex As Integer = NoValue

 

Rule b%%signatureRequired As Boolean
  If sPartName = "" Then
    Return True
  Else
    Return False
  End If
End Rule

Rule sCacheFactoryFile As String
  If sPartName = "" Then
    Return iv_pathFileNameOnly(FactoryFileName)
  Else
    If iPartIndex = NoValue Then
      Return sPartName
    Else
      Return sPartName + "_" + stringValue(iPartIndex)
    End If
  End If
End Rule



' Member (instance) file
' File name (including extension) of cached member file
<%%Category("Inventor") > _
Rule cacheFileName As String
  If b%%signatureRequired Then
    Return sCacheFactoryFile + "." + %%Signature + iv_pathExtension(FactoryFileName)
  Else
    Return sCacheFactoryFile + iv_pathExtension(FactoryFileName)
  End If
End Rule

 

Use sPartName as additional parameter for each part.

Use iPartIndex as additional parameter for list of parts.

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report