- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am currently trying to automatically fill the stock number of a part to "SEE CHART" if the part is an iPart and simply fill the part number of it's a regular part. I have this bit of an iLogic rule I got working looking at some other variable for the time being, but I'm not sure how to code in to see if something is an iPart or not.
Any help is much appreaciated.
Dim oPN As String
oPN = iProperties.Value("Project", "Part Number")
Dim oSN As String
oSN = iProperties.Value("Project", "Stock Number")
If "Part is an iPart" Then
iProperties.Value("Project", "Stock Number") = "SEE CHART"
Else
iProperties.Value("Project", "Stock Number") = oPN
End If
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @s.mich, you can check if a part is an iPart by checking the "IsiPartFactory" property of its ComponentDefinition:
If ThisDoc.Document.ComponentDefinition.IsiPartFactory Then
' Do stuff...
Else
' Do other stuff...
End If
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Quick note for anyone else referencing this: If this iLogic might possibly run on an assembly document or drawing document, you will need to first make sure that the document is a part document, otherwise it will throw an exception.
If ThisDoc.Document.DocumentType = documenttypeenum.kPartDocumentObject _
AndAlso ThisDoc.Document.ComponentDefinition.IsiPartFactory Then
' Do stuff...
Else
' Do other stuff...
End If