One of the products I am supporting currently is “Engineer-To-Order” (ETO). When I see a good tip or solution that applies to ETO for Inventor I am going to post it here. Here is the first post for this product and it shows a way to create a custom iProperty when the member file is saved.
When a member document is about to be saved the GetNewPartNumber() method is called. You can override this method and get and set data. (This is exactly the right time to do this). Geometry-wise the document is in a good shape, because it contains the required values of Inventor Parameters, sheet metal defaults, etc.
The example below was used for a sheet metal part. The highlighted lines do the following:
1. Extract the “lengths” of the Flat Pattern as an Intent List
2. Formats a string from the List
3. Creates the custom iProperty FlatPatternSize in the member IPT document
< %%category("Inventor") > _
Method GetNewPartNumber( docHandle As String) As String
Dim fpLengths As List = _
IvExtGetFlatPatternLenghts _
( Parent,False,"in", docHandle:=docHandle)
Dim strList As String = "FP Lengths: " _
+ StringValueEx( fpLengths, :AsFormula)
iv_documentPropertyPut _
( docHandle, "FlatPatternSize", _
strList, createNew?:=True)
'
' the rest is original implementation from
' %%IvAdoptedPart Design
'
Dim iPropertiesPN As String = _
iv_ExtractPartNumber( iProperties)
If( length(iPropertiesPN) > 0) Then
Return iPropertiesPN
End If
If UseFactoryPartNumber? Then
Return ""
End If
Return iv_pathFileNameOnly( %%cacheFilePath)
End Method
- Wayne


Subscribe