Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings all!
Let me preface by saying I code like a toddler.
What I'm trying to do is have a rule that checks if the Stock Number is > 18 characters and the Description is > 40 characters. If it is, I have an error message that displays, warning the designer.
I have 2 problems.
- I need this to work for assemblies/parts created before today. The event triggers placed on a standard part/assy file will only apply to anything created after today.
- I have a dirty way to get around this by using iLogicVb.RunExternalRule("ruleFileName") in an existing rule and piggy backing off existing triggers. Plan is to use that for 3-6 months until we get through the older stuff.
- The other issue is the rule I created only checks the current open file. If there are issues with 3 parts in an assembly, it just returns the error of the assembly 3x.
I tried searching the forums but didn't find anything or maybe I wasn't asking the right question.
Code posted below and thanks in advance.
Best,
Gabe
If Len(iProperties.Value("Project", "Description")) > 40 And Len(iProperties.Value("Project", "Stock Number")) > 18 Then MessageBox.Show("Error, Description Exceeds 40 Characters" _ & vbLf & "" _'blank & vbLf & "Error, SAP Exceeds 18 Characters" _ & vbLf & "" _ 'blank & vbLf & ThisDoc.FileName(True) _ & vbLf & "" _ 'blank & vbLf & ThisDoc.Path, "Desc & SAP Error") Else If Len(iProperties.Value("Project", "Description")) > 40 And Len(iProperties.Value("Project", "Stock Number")) <= 18 Then MessageBox.Show("Error, Description Exceeds 40 Characters" _ & vbLf & "" _ 'blank & vbLf & ThisDoc.FileName(True) _ & vbLf & "" _ 'blank & vbLf & ThisDoc.Path, "Desc Error") Else If Len(iProperties.Value("Project", "Description")) <= 40 And Len(iProperties.Value("Project", "Stock Number")) > 18 Then MessageBox.Show("Error, SAP Number Exceeds 18 Characters" _ & vbLf & "" _ 'blank & vbLf & ThisDoc.FileName(True) _ & vbLf & "" _ 'blank & vbLf & ThisDoc.Path, "SAP Error") End If
Gabe Cain
Structural Designer/Engineering Checker
Structural Designer/Engineering Checker
Solved! Go to Solution.