exportLayoutAsGeometry is not working

Hi,

I am trying to create a python add-on to export the layout as a STL file. I am using the command exportLayoutAsGeometry for that, but when I execute the command, nothing happens (no dialog is opened as mentioned in the documentation).

Here is my export.py add-on:

from vcCommand import *

app = getApplication()
def OnExecute():
    command =app.findCommand("exportLayoutAsGeometry")
    command.recompile()
    command.execute()
addState(OnExecute)

Here is my init.py:

export_uri = getApplicationPath() + "export.py"
cmd = loadCommand("Export",export_uri) 
addMenuItem("VcTabHome/Variables","Export", -1, "Export", "", "rAdd","gmTool", "GalleryMenuToolItem")

I have Visual Components 4.0.5 Premium