• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - TCL
  3. Checking Menu Item states from tcl script

Stats

  • State Verified Answer
  • Replies 5
  • Subscribers 14
  • Views 1424
  • Members are here 0
More Content

Checking Menu Item states from tcl script

HH202501061832
HH202501061832 6 months ago

Hello, 

I'm writing a script that will run a bunch of commands at startup, including setting some user-defined hotkeys and setting up some menu item state to a default value, 

Say I'm trying to set "Grid References" to the "unchecked" state at startup. How can i do that in tcl? 
I can toggle it by using: Menu "View::Grid References"

 But with that, i can't force it to be unchecked, i can just toggle it,

Is there a way for me to check the state of the menu item before applying the toggle event? 

It might be something simple such as a command that i missed, i'm not super familiar with the command structure here, just trying out a few things to learn them. 

Thank you

  • Sign in to reply
  • Cancel
  • Andrew Beckett
    0 Andrew Beckett 6 months ago

    What tool are you using here? I suspect you’re posting in the wrong place because Virtuoso doesn’t have a menu like that and it wouldn’t be set in TCL anyway.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • HH202501061832
    0 HH202501061832 6 months ago in reply to Andrew Beckett

    Oh, I'm using Orcad Capture CIS. I guess i am in the wrong section. Could you suggest where this could be posted? Thank you 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Andrew Beckett
    0 Andrew Beckett 6 months ago in reply to HH202501061832

    I moved it to one of the Orcad forums.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    +1 CadAP 6 months ago

     HH20250106183 

    You can use below command to check the status and enable the "Grid References" value page wise.

    GetGridRefDisplayed(status) : returns int
    Class : DboPage(DboBaseObject):
    Parameters:
    status: DboState &

    SetGridRefDisplayed(bVal) : returns DboState
    Class : DboPage(DboBaseObject):
    Parameters:
    bVal: int

    Step to get page grid references

    1. Open a page

    2. Get Active page DBid using "GetSelectedPMITems"

    3.Type [GetSelectedPMITems] GetGridRefDisplayed [DboState]--> It will return 1 0r 0 based on enabled disabled status.

    Hope it helps.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • HH202501061832
    0 HH202501061832 6 months ago in reply to CadAP

    Thank you, Helped a bunch.
    Worth to note that those functions are defined as DboPage_GetGridRefDisplayed and DboPage_SetGridRefDisplayed in (at least) my version of Capture CIS, different from the tcl extension file that is provided with the software. 

    My code looks like the following now, if there is a need to have the Grid References turned off at startup (I did it because my zooming was messing up when it is ON): 

    set activePage [GetSelectedPMItems]
    set lStatus [DboState]
    set return_state [DboPage_GetGridRefDisplayed $activePage $lStatus]
    if {$return_state == 1} {
         DboPage_SetGridRefDisplayed $activePage 0
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information