function closes property manager page

Hello All,

I have written a function in dll which gets executed once the entity is selected in drawing document.

This function UserSelectionPostNotify() shows the property manager page but when the code gets executed propertymanager pages gets closed.

After  debugging I came to know that when end function gets called immediately property manager page after close getscalled and page closes.

Please give me solution for the same.

Private Function DOC_UserSelectionPostNotify() As Long


    MsgBox "Entity selected in a drawing document."

    Set swSelMgr = swModel.SelectionManager
    Set skMgr = swModel.SketchManager
    vBlocks = skMgr.GetSketchBlockDefinitions
    Set pBlock = vBlocks(0)
    vInstances = pBlock.GetInstances
    Set selBlockInst = swSelMgr.GetSelectedObject6(1, -1)

Newpage.show

End Function

Public Sub PropertyManagerPage2Handler5_AfterClose()

End Sub

-Sanjay

SolidworksApi macros