BeforeorAfter Not Firing

BeforeorAfter Not Firing

Anonymous
Not applicable
358 Views
7 Replies
Message 1 of 8

BeforeorAfter Not Firing

Anonymous
Not applicable
I have: Private Sub oAppEvents_onSaveDocument(ByVal DocumentObject As Document, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum) If BeforeOrAfter = kBefore Then 'do nothing ElseIf BeforeOrAfter = kAfter Then 'do something else End If End Sub It fires the before event but never comes back to fire the after event. Any ideas? -- Sean Dotson, PE www.sdotson.com Autodesk Inventor Certified Expert Sidel, Engineering & Manufacturing Manager
0 Likes
359 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
I had the same problem so I used the numbers instead of the kbefore etc 4099 = abort 4098 = after 4097 = before If BeforeOrAfter = 4097 Then -- Paul Houlker Rimex Supply Ltd www.rimex.com
0 Likes
Message 3 of 8

Anonymous
Not applicable
Hmmm, still no go. I can step it thru the kBefore section but it never comes back around for the kAfter. -- Sean Dotson, PE www.sdotson.com Autodesk Inventor Certified Expert Sidel, Engineering & Manufacturing Manager "Paul Houlker" <111Nospam111paulh@imex.com> wrote in message news:41bde79c$1_3@newsprd01... > I had the same problem so I used the numbers instead of the kbefore etc > 4099 = abort 4098 = after 4097 = before > > If BeforeOrAfter = 4097 Then > > > -- > Paul Houlker > Rimex Supply Ltd > www.rimex.com > >
0 Likes
Message 4 of 8

Anonymous
Not applicable
I threw a check into mine and its hitting the after event, cant see any glaring differences between the code, sorry. Here is my sub incase it helps Private Sub MyAppEv_OnSaveDocument(ByVal DocumentObject As Document, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum) Dim strFileLocation As String strFileLocation = oApp.ActiveDocument.FullFileName strFileLocation = ConvertToUNC(strFileLocation) strFileLocation = Left(strFileLocation, 25) If strFileLocation = "\\SERVER2\SYS\GENERAL\DWG" Then If oApp.ActiveDocument.DocumentType = kDrawingDocumentObject Then If BeforeOrAfter = 4097 Then SaveAsDWF "Auto" End If If BeforeOrAfter = 4098 Then MsgBox "After" End If End If End If -- Paul Houlker Rimex Supply Ltd www.rimex.com
0 Likes
Message 5 of 8

Anonymous
Not applicable
If changes were made to the object that DocumentObject refers to (i.e., DocumentObject.Dirty = True), then then event fires once with BeforeOrAfter = kBefore, then again with BeforeOrAfter = kAfter. If the document in question didn't have any changes made to it (i.e., DocumentObject.Dirty = False), then the event only fires once for BeforeOrAfter = kBefore. -------------------------------------------------------------------------------- Brian R. Iwaskewycz Senior Mechanical Engineer PA Transformer Technology, Inc. I've got a feelin' Pittsburgh's goin' to the Superbowl
0 Likes
Message 6 of 8

Anonymous
Not applicable
That was it Brian. I absent-mindedly had just been testing by saving a freshly saved document. Thanks to both you and Paul... -- Sean Dotson, PE www.sdotson.com Autodesk Inventor Certified Expert Sidel, Engineering & Manufacturing Manager "Brian Iwaskewycz" wrote in message news:41be0707_3@newsprd01... If changes were made to the object that DocumentObject refers to (i.e., DocumentObject.Dirty = True), then then event fires once with BeforeOrAfter = kBefore, then again with BeforeOrAfter = kAfter. If the document in question didn't have any changes made to it (i.e., DocumentObject.Dirty = False), then the event only fires once for BeforeOrAfter = kBefore. ------------------------------------------------------------------------------ Brian R. Iwaskewycz Senior Mechanical Engineer PA Transformer Technology, Inc. I've got a feelin' Pittsburgh's goin' to the Superbowl
0 Likes
Message 7 of 8

Anonymous
Not applicable
So, if you look at my code I am creating a DWF when an IDW residing in a certain directory structure is saved. From reading your info Brian I would be better off only capturing the kafter event since I dont need an updated DWF created if nothing has changed. nice info -- Paul Houlker Rimex Supply Ltd www.rimex.com
0 Likes
Message 8 of 8

Anonymous
Not applicable
Correct. -- Sean Dotson, PE www.sdotson.com Autodesk Inventor Certified Expert Sidel, Engineering & Manufacturing Manager "Paul Houlker" <111Nospam111paulh@imex.com> wrote in message news:41be1a46_3@newsprd01... So, if you look at my code I am creating a DWF when an IDW residing in a certain directory structure is saved. From reading your info Brian I would be better off only capturing the kafter event since I dont need an updated DWF created if nothing has changed. nice info -- Paul Houlker Rimex Supply Ltd www.rimex.com
0 Likes