Dim swApp As SldWorks.SldWorks
Set swApp = Application.SldWorks
swApp.RunCommand swCommands_e.swCommands_PmOK, ""
Thanks for the reply.
That works but freezes my solidworks and crashes it all the time.
int pDoc_AddItemNotify(int EntityType, string itemName)
Solidworks does run with any problem if RunCommand code is commented. What might be the reason for that?
That's probably a risky thing to close the pmp within the AddItem notification. The reason is that your library feature is not yet fully created. Try to listen for OnIdle notification once AddItem is called. This will be a safe place to close the PMP.