BeforeorAfter Not Firing

BeforeorAfter Not Firing

Anonymous
不适用
356 次查看
7 条回复
1 条消息(共 8 条)

BeforeorAfter Not Firing

Anonymous
不适用
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 个赞
357 次查看
7 条回复
回复 (7)
2 条消息(共 8 条)

Anonymous
不适用
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 个赞
3 条消息(共 8 条)

Anonymous
不适用
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 个赞
4 条消息(共 8 条)

Anonymous
不适用
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 个赞
5 条消息(共 8 条)

Anonymous
不适用
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 个赞
6 条消息(共 8 条)

Anonymous
不适用
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 个赞
7 条消息(共 8 条)

Anonymous
不适用
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 个赞
8 条消息(共 8 条)

Anonymous
不适用
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 个赞