Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to make an iLogic rule that will sort through an assembly, and change the description of sheet metal parts to "=<Thickness> PL".
I found this thread that help for the sorting, and changing the custom parameter formatting, but I'm struggling making it work.
This is what I have, it seems to run through the parts, but it doesn't seem to make the changes I'm looking for.
SyntaxEditor Code Snippet
'Define the open document Dim openDoc As Document openDoc = ThisApplication.ActiveDocument 'Look at all of the files referenced in the open document Dim partDoc As Document For Each partDoc In openDoc.AllReferencedDocuments 'look at only part files If partDoc.DocumentType = kPartDocumentObject Then 'format file name Dim FNamePos As Long FNamePos = InStrRev(partDoc.FullFileName, "\", -1) Dim docFName As String docFName = Right(partDoc.FullFileName, Len(partDoc.FullFileName) - FNamePos) Dim userParam As UserParameter For Each userParam In partDoc.ComponentDefinition.Parameters.UserParameters If userParam.Name = "Thickness" userParam.ExposedAsProperty = True Dim cFormat As CustomPropertyFormat = userParam.CustomPropertyFormat cFormat.PropertyType = CustomPropertyTypeEnum.kTextPropertyType cFormat.Precision = CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision cFormat.Units = "in" iProperties.Value("Project", "Description")="=<Thickness> PL" End If Next 'rebuild to update the display partDoc.Update End If Next openDoc.Rebuild
Solved! Go to Solution.