Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using the Job processor to publish drawings to our PLM system.
We have experienced situations where the designer have overseen a missing Design doctor issue, or a view is not updated. Hence the Job processor produces non-predictable results.
Implementing an ilogic script that validates the drawing and stores the result in a custom iProperty: HealthStatus. We then implement a State Change rule in Vault preventing the files from being released unless HealthStatus="OK".
' Get active document Dim doc As Document = ThisApplication.ActiveDocument ' Initialize HealthStatus as OK Dim healthStatus As String = "OK" ' Check if document needs migration or an update Dim issues As String = "" If doc.NeedsMigrating Then issues &= "NeedsMigration | " End If If doc.RequiresUpdate Then issues &= "RequiresUpdate | " End If ' Check Design Doctor status using UI button Try Dim ribbons As String() = {"Part", "Assembly", "Drawing"} For Each rib In ribbons Try Dim cmd As ControlDefinition = ThisApplication.UserInterfaceManager.Ribbons.Item(rib).QuickAccessControls.Item("AppDesignDoctorCmd").ControlDefinition If cmd.Enabled Then issues &= "DesignDoctorIssues | " Exit For End If Catch ex As Exception ' Ignore if ribbon is not available End Try Next Catch ex As Exception ' Ignore errors End Try ' Check if drawing views are outdated (for drawings only) If TypeOf doc Is DrawingDocument Then Dim drawDoc As DrawingDocument = doc For Each oSheet As Sheet In drawDoc.Sheets For Each oView As DrawingView In oSheet.DrawingViews messagebox.Show(oview.IsUpdateComplete & oView.UpToDate) If Not oView.UpToDate Then issues &= "OutdatedDrawingView | " End If Next Next End If ' Remove trailing "| " if any issues were found If issues <> "" Then healthStatus = issues.TrimEnd(" |".ToCharArray()) End If ' Update the iProperty "HealthStatus" Try Dim propSet As PropertySet = doc.PropertySets.Item("Inventor User Defined Properties") Try propSet.Item("HealthStatus").Value = healthStatus Catch propSet.Add(healthStatus, "HealthStatus") End Try Catch ex As Exception ' Ignore errors End Try
Almost working, except that I can not capture the Update View scenario. The icon shows the drawing is not up to date, but neither oview.IsUpdateComplete & oView.UpToDate shows false.
Solved! Go to Solution.