- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Leonardo,
As alluded to earlier, you can use the fact that content center parts contain property information to quickly determine whether a component occurrence came from somewhere in the structural shapes content folder.
As mentioned, use the ComponentDefinition.IsContentMember property to determine if the part is from the content center, and if required, check the only property in the PropertySets.Item(6) property set to determine if the part is a custom or standard content center part.
Although not visible through the user interface, the design tracking property set contains a few properties that only hold information if the part comes from the content center. The "Categories" property [ PropertySets.Item(3).ItemByPropId(56) ] has a complete xml description of the specific content center part.
This xml information is stored as a text string, accessible through the Value property of this Inventor property. Since you are only looking to find if this came from the structural shapes folder in the content center, you just need to check to see if this text string contains the unique identifier for the Structural Shapes folder. The attached text file is a portion of this text string and you can see the information on the CC folder is right at the top. The "Structural Shapes" display name is likely to be localized for the current language but the Internal Name of this folder will always be the same.
To check if the part is from the Structural Shapes CC folder, use something like the following.
If PropertySets.Item(3).ItemByPropId(56).Value.Contains("089c4875-fa83-4c05-b084-43b9cc11f5ed") Then
' this part is from the structural shapes CC folder
End If
Note: Apply appropriate error handling with all code.