AnsweredAssumed Answered

GetCustomProperties Silently

Question asked by Darren Smith on Jun 5, 2017
Latest reply on Jun 6, 2017 by Deepak Gupta

Can anybody help????


I have the following macro:


Public Function GetCustomProperties()
    Dim FileError As Long

    Dim FileWarning As Long

    Set swApp = Application.SldWorks

    swApp.DocumentVisible False, swDocumentTypes_e.swDocPART

    Set oDoc = swApp.OpenDoc6("C:\Test.sldprt", swDocPART, swOpenDocOptions_Silent, "", FileError, FileWarning)

    PartType = oDoc.GetCustomInfoValue("", "Part: Type")

    PartMaterial = oDoc.GetCustomInfoValue("", "Part: Material")

    Description = oDoc.GetCustomInfoValue("", "Part: Description")

    swApp.DocumentVisible True, swDocumentTypes_e.swDocPART
End Function


I need to open the part "Silently" and get the part Type, Material & Description. I have attached a sample part.


However the macro does not work. Has anybody got any idea what I am doing wrong?


Many thanks in advance!!!!