Message 1 of 4
Interrupt 'Save Document' from iLogic rule started with Event Trigger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is it possible to stop a Save Document action from an iLogic rule who is fired with an Event Triger Before Save Document?
When reuse a drawing and do a 'Replace Model Reference' there is a chance to forgot to change to the new drawing name.
Therefore I wrote a iLogic rule that is comparing the model file name with the drawing file name and gives a warning when there is a difference between.
I would like to give the user YES/NO buttons and when go for NO to stop the Save Document action.
Is that possible while using the regular ctrl-S and save button?
In other words, can the iLogic rule intervene in the running process?
' Check_Drawing_Reference
' Get model doc and path
Try
'Find the first model ref in the drawing
Dim iDoc As Document = ThisApplication.ActiveDocument
oPathIdoc = iDoc.FullFileName
oDoc = ThisDrawing.ModelDocument
oPath = oDoc.FullFileName
Catch
MessageBox.Show("Could not get model reference.", "iLogic")
Return
End Try
strText = "Drawing filename is not the same as model filename!" & vbNewLine & vbNewLine & _
"Model:" & vbNewLine & Left(oPath, Len(oPath) -4) & vbNewLine & vbNewLine & _
"Drawing:" & vbNewLine & Left(oPathIdoc, Len(oPathIdoc) -4)
' Compare Model doc and Drawing doc
If Left(oPath, Len(oPath)-4) <> Left(oPathIdoc, Len(oPathIdoc)-4) Then
MessageBox.Show(strText, "WARNING!",MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If