• 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. Execute TCL command after opening design finsished

Stats

  • State Verified Answer
  • Replies 3
  • Subscribers 12
  • Views 2505
  • Members are here 0
More Content

Execute TCL command after opening design finsished

ggeorgg
ggeorgg over 1 year ago

Hi!

I want to execute some TCL code after a design has been opened. Can someone provide an example if this is possible? I tried it with the action "_cdnOrNotifyDesignOpened", but without success...

Thanks in advance!

Best regards

Georg

  • Cancel
  • Sign in to reply
Parents
  • CadAP
    +1 CadAP over 1 year ago

    HI George,

    Please use the sample code for running proc after design open.

    After sourcing the below code it will show you the design loaction in capture command window.

    Also you can keep the file at C:\Cadence\SPB_22.1\tools\capture\tclscripts\capAutoLoad for auto load in capture.

    I am using SPB_22.1.

    #Test code

    proc designName {args} {
    set lDesignNameCstring [DboTclHelper_sMakeCString]
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set activedesign [$lSession GetActiveDesign]
    $activedesign GetName $lDesignNameCstring

    puts "Design_Location: [DboTclHelper_sGetConstCharPtr $lDesignNameCstring]"
    }

    proc capTrue {args} {
    return 1

    }

    RegisterAction "_cdnOrNotifyDesignOpened" "capTrue" "" "designName" ""

    Thanks

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • CadAP
    +1 CadAP over 1 year ago

    HI George,

    Please use the sample code for running proc after design open.

    After sourcing the below code it will show you the design loaction in capture command window.

    Also you can keep the file at C:\Cadence\SPB_22.1\tools\capture\tclscripts\capAutoLoad for auto load in capture.

    I am using SPB_22.1.

    #Test code

    proc designName {args} {
    set lDesignNameCstring [DboTclHelper_sMakeCString]
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set activedesign [$lSession GetActiveDesign]
    $activedesign GetName $lDesignNameCstring

    puts "Design_Location: [DboTclHelper_sGetConstCharPtr $lDesignNameCstring]"
    }

    proc capTrue {args} {
    return 1

    }

    RegisterAction "_cdnOrNotifyDesignOpened" "capTrue" "" "designName" ""

    Thanks

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
  • ggeorgg
    0 ggeorgg over 1 year ago in reply to CadAP

    Thanks, this works. Seams I made some kind of error in the first place when using _cdnOrNotifyDesignOpened...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ggeorgg
    0 ggeorgg over 1 year ago in reply to CadAP

    I tried your suggestion with placing the code in the capAutoLoad directory, but it did not always work. It dependet on the file name in which this code was stored. Think the issue is caused by the file C:\Cadence\SPB_22.1\tools\capture\tclscripts\capAutoLoad\capAppLaunchMenu.tcl

    In this file the capTrue procedure is defined without arguments like this:

    proc capTrue {} {
        return true
    }
    But the "Enabler" procedure needs to have arguments, otherwise the procedure designName is never triggered. 
    So when loading your code before capAppLaunchMenu.tcl gets loaded by the capture startup, the procedure designName is not triggered.
    Solution is to just use a different name for the capTrue procedure. Maybe Cadence reads this as well, then they can change add "args" to the capTrue in the mentioned file. I think it is missing there.
    • 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