2 Replies Latest reply on May 18, 2018 5:35 AM by Sacchin Hd

    FileNewNotify2 API event is not triggered for imported models

    Sacchin Hd

      Hi Guys,

      Importing .stl, .iges files dose to trigger FileNewNotify2 event anymore. This is the case in Solidworks 2017 but wont work on Solidworks 2018.

        • Re: FileNewNotify2 API event is not triggered for imported models
          Jacob Corder

          if that is the case, will ActiveModelDocChangeNotify work?

           

          i would assume that FilenewNotify2 would not fire because its actually not a new file in 2018.  since 2018 has the ability to use non solidworks files.

           

          so use Sldworks::DocumentLoadNotify2 or

          Sldworks.FileOpenPostNotify (I use this one)

           

          i assume anything without an extension and is only in memory would be fired by FileNewNotify2

            • Re: FileNewNotify2 API event is not triggered for imported models
              Sacchin Hd

              ActiveModelDocChangeNotify is working. But neither DocumentLoadNotify2  nor FileOpenPostNotify  is being triggered for .stl files.

              ---------------------------------------------------------------------------

              These are the events triggered for .stp file on file open

              ---------------------------------------------------------------------------

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_BufferSwapNotify

              ModelView_RepaintPostNotify

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_BufferSwapNotify

              ModelView_RepaintPostNotify

              SWSession_PromptForFilenameNotify

                OpenOrSave   =  1

                SuggFileName =

                DocType      =  0

                Unused       =  1

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_RepaintPostNotify

              ---------------------------------------------------------------------------

              Where as for native model (.sldprt) these events are triggered

              ---------------------------------------------------------------------------

              SWSession_PromptForFilenameNotify

                OpenOrSave   =  1

                SuggFileName =

                DocType      =  0

                Unused       =  1

              SWSession_DocumentLoadNotify

                DocTitle     = Part21.SLDPRT

                DocPath      = D:\WaveFEA\Bugs\Import-WF\Part21.SLDPRT

              SldWorks_ActiveDocChangeNotify

                ActiveDoc    = D:\WaveFEA\Bugs\Import-WF\Part21.SLDPRT

              SldWorks_ActiveModelDocChangeNotify

                ActiveModDoc = D:\WaveFEA\Bugs\Import-WF\Part21.SLDPRT

              SldWorks_FileOpenNotify

                FileName     = D:\WaveFEA\Bugs\Import-WF\Part21.SLDPRT

              PartDoc_LoadFromStorageNotify

              SWSession_FileOpenNotify2

                FileName     = D:\WaveFEA\Bugs\Import-WF\Part21.SLDPRT

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_RepaintPostNotify

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_BufferSwapNotify

              ModelView_RepaintPostNotify

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_BufferSwapNotify

              ModelView_RepaintPostNotify

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_BufferSwapNotify

              ModelView_RepaintPostNotify

              ModelView_RepaintNotify

                PaintType    = swStandardUpdate

              ModelView_BufferSwapNotify

              ModelView_RepaintPostNotify

              ---------------------------------------------------------------------------