Hello Harry,
This Code works. Let me know if your problem is'nt solved.
Public Sub UpdateDraft() On Error Resume Next
Dim objApp As SolidEdgeFramework.Application Dim objDoc As SolidEdgeDraft.DraftDocument Dim objSheet As SolidEdgeDraft.Sheet
Dim objDrawingViews As SolidEdgeDraft.DrawingViews Dim objDrawingView As SolidEdgeDraft.DrawingView
Dim DrawingViewNeedsUpdate As Boolean
'Get SE en open document Set objApp = GetObject(, "SolidEdge.Application")
If Err Then Err.Clear Set objApp = CreateObject("SolidEdge.Application") End If 'Open document Set objDoc = objApp.ActiveDocument 'Visible objApp.Visible = True objApp.DisplayFullScreen = True 'Set Set objSheet = objDoc.ActiveSheet Set objDrawingViews = objSheet.DrawingViews DrawingViewNeedsUpdate = False 'Loop throug the drawingviews and check each one of them. 'If one of the views is out of date, the Boolean is True For Each objDrawingView In objDrawingViews If objDrawingView.IsUpToDate = False Then DrawingViewNeedsUpdate = True Exit For DrawingViewNeedsUpdate = True Else DrawingViewNeedsUpdate = False End If Next 'Show the messagebox If DrawingViewNeedsUpdate = True Then MsgBox "Update the drawing and change the filename of the pdf-file" End If
'Release variables Set objApp = Nothing Set objDoc = Nothing Set objSheet = Nothing Set objDrawingViews = Nothing Set objDrawingView = Nothing End Sub
Best Regards,
Wouter (Erwo) |