Message 1 of 3
ilogic help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a bit of iLogic code that works on flat patterns and I need some help adding a new function to it. On the bend note if there is a bend radius of 11/16 I need it to give me a field where I can say, "See forming guide." The full text should read, "<DIR> <ANGL> R <RAD> SEE FORMING GUIDE." Below is the rule I would like to add this functionality to. Thank you!
doc = ThisDoc.Document
For Each oSheet In doc.Sheets
For Each oView In oSheet.DrawingViews
If oView.IsFlatPatternView Then
oView.ShowLabel = True 'Turn on view label
'oFSize = .1 'font size, units unknown
ViewLabel = oView.Name
'clear current view label
oView.Label.FormattedText = ""
oModelName = _
oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
Try
oFSize = .1*2.54
oMaterial = "<StyleOverride Underline='False'><Property Document='model' PropertySet='Design Tracking Properties' Property='Material' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"
oGauge = iProperties.Value(oModelName, "Custom", "ShtThk")
oLength = iProperties.Value(oModelName, "Custom", "FlatLength")
oWidth = iProperties.Value(oModelName, "Custom", "FlatWidth")
oMaterial = iProperties.Value(oModelName, "Custom", "Material")
'oName = iProperties.Value("Project", "Part Number") 'Only got the .idw file name
oName = iProperties.Value(oModelName, "Custom", "FileName")
'add the the iProperty to the current view label, with a dash separator
oView.Label.FormattedText = "<StyleOverride FontSize='" & oFSize & "'>" & oMaterial & " - "& oGauge & vbCrLf & oLength & " x " & oWidth & vbCrLf & oName & "</StyleOverride>"
'oOldLabel = oView.Label.Text
'oView.Label.FormattedText = "<StyleOverride FontSize='" & oFSize & "'>" & oOldLabel & "</StyleOverride>"
Catch
'do nothing if error
End Try
End If
If Not oView.IsFlatPatternView Then
' MsgBox("Not a Flat Pattern")
'capture the current view label
ViewLabel = oView.Name
'clear current view label
' oView.Label.FormattedText = "insert here"
oModelName = _
oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
Try
o_iProp = iProperties.Value(oModelName, "Project", "Part Number")
'add the the iProperty to the current view label, with a dash separator
' oView.Name = o_iProp
oView.Label.FormattedText = o_iProp
Catch
'do nothing if error
End Try
End If
Next
Next