Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI!
My goal is to populate the "Area" Property in every Assembly parts, among other properties.
I'm able to manage other custom propertiesand sheet metal extends, but i'm not able to do that with the "Area".
Any help?
In the code below, Sheet metal extends and custom properties are working. Any idea for Area? Thanks.
SyntaxEditor Code Snippet
Dim openDoc As Document openDoc = ThisApplication.ActiveDocument Dim docFile As Document For Each docFile In openDoc.AllReferencedDocuments If docFile.SubType.Equals("{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}") Then docFile.PropertySets.Item("Design Tracking Properties").Item("Description").Value= "SheetMetal" 'docFile.ComponentDefinition.Parameters("Thickness").ExposedAsProperty = True oParam = docFile.ComponentDefinition.Parameters("Thickness") oParam.ExposedAsProperty = True oCustomPropertySet = docFile.PropertySets.Item _ ("Inventor User Defined Properties") On Error Resume Next oCustomPropertySet.Item("", "SM_Length").Value = "=<Sheet Metal Length>" If Err.Number <> 0 Then oCustomPropertySet.Add("", "SM_Length").Value = "=<Sheet Metal Length>" End If oCustomPropertySet.Item("", "SM_Width").Value = "=<Sheet Metal Width>" If Err.Number <> 0 Then oCustomPropertySet.Add("", "SM_Width").Value = "=<Sheet Metal Width>" End If oCustomPropertySet.Item("", "Area").Value = "=<Area?????????????>" If Err.Number <> 0 Then oCustomPropertySet.Add("", "Area").Value = "=<Area???????????????>" End If Else docFile.PropertySets.Item("Design Tracking Properties").Item("Description").Value = "Part" oCustomPropertySet = docFile.PropertySets.Item _ ("Inventor User Defined Properties") On Error Resume Next oCustomPropertySet.Item("", "Area").Value = "=<Area?????????????>" If Err.Number <> 0 Then oCustomPropertySet.Add("", "Area").Value = "=<Area??????????????>" End If End If Next
CCarreiras
Solved! Go to Solution.