How to count the opened documents during run time?

Hi All,

Is there a way to count the no.of opened documents at a time?

I tried with GetDocumentCount method, for a single assembly/drawing it gives 2 as a value( even its dependent part document is in opened condition), sometimes 1 as a value.

I am trying to identify at what condition i deactivate my custom menu.

Requirement: if there is no open document, no custom menu should be active.

Thanks,

Saravanan.R

SolidworksApi macros