[CONNECT] Check if Design History is enabled in VBA?

Hi all,

Does anyone know of a method in VBA to detect if the active design file has Design History enabled or not?

The mdl wrapper method i found in old posts crashes in CE and the Property Handler method always results in a negative result.

Regards,

Mark

Parents Reply
  • mdlHistory_exists(mdlModelRef_getDgnFile(mdlModelRef_getActive())

    You probably need to modify the function declarations to be compatible with 64-bit CONNECT.  Those go at the top of your VBA module...

    Declare PtrSafe Function mdlHistory_exists Lib "stdmdlbltin.dll" ( ByVal pFile As LongPtr ) As Long 
    Declare PtrSafe Function mdlDgnFileObj_getMasterFile Lib "stdmdlbltin.dll" ( ) As LongPtr 

    Now you should be able to use Jan's suggestion.  Wrap it in a VBA function to avoid polluting your other code...

    Public Function HistoryExists () As Boolean
      HistoryExists = 0 <> mdlHistory_exists(mdlDgnFileObj_getMasterFile())
    End Function

     
    Regards, Jon Summers
    LA Solutions

Children
No Data