Home > Community > Forums > Functional Verification > Solved :: added tcl script in the menu instead::Add tcl script to tcl/tk Application Dashboard

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Solved :: added tcl script in the menu instead::Add tcl script to tcl/tk Application Dashboard 

Last post Tue, Nov 27 2012 11:20 PM by vidyutt. 4 replies.
Started by vidyutt 27 Nov 2012 05:42 AM. Topic has 4 replies and 1680 views
Page 1 of 1 (5 items)
Sort Posts:
  • Tue, Nov 27 2012 5:42 AM

    • vidyutt
    • Not Ranked
    • Joined on Sun, Jan 2 2011
    • Posts 5
    • Points 85
    Solved :: added tcl script in the menu instead::Add tcl script to tcl/tk Application Dashboard Reply

    Hi,

     I have created a small tcl script to modify the some properties on the Title Block. I wish to add the Script to the TCL/Tk Applications Dashboard.I followed the instructions in the OrCAD_Capture_TclTk_Extensions.pdf. I have added the script in the folder “C:\Cadence\SPB_16.5\tools\capture\tclscripts\capUtils” and modified the file capApps.tcl in the “C:\Cadence\SPB_16.5\tools\capture\tclscripts\capForms” folder. I restart my Orcad Session, I can see the entry in the dashboard. However, upon clicking on ‘Launch’ I get the error "error ::capTitleBlockEditUtil::EditTitleBlockOnPage not defined"

    my script is ::

    package require Tcl 8.4

    package require DboTclWriteBasic 16.3.0

    package provide capTitleBlockEditUtil 1.0

     

    namespace eval capTitleBlockEditUtil {

    namespace export EditTileBlockOnPage

    }

    proc capTitleBlockEditUtil::EditTileBlockOnPage {} {
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]
    set pDesignPath C:/ecad/staging/vila/bimu_1405135821/orcad/latest/0010/test.dsn
    set lDesignPath [DboTclHelper_sMakeCString $pDesignPath]
    set lDesign [$lSession GetDesignAndSchematics $lDesignPath $lStatus]

    set pSchematicName SCHEMATIC1
    set lSchematicName [DboTclHelper_sMakeCString $pSchematicName]
    set lSchematic [$lDesign GetSchematic $lSchematicName $lStatus]

    set pPageName PAGE1
    set lPageName [DboTclHelper_sMakeCString $pPageName]
    set lPage [$lSchematic GetPage $lPageName $lStatus]

    set lTitleBlockId [$lPage GetTitleBlockDisplayed  $lStatus]
    set Titile [$lPage GetTitleBlock $lTitleBlockId $lStatus]

    set pPname Title
    set lTitlePName [DboTclHelper_sMakeCString $pPname]
    set lNameValue [DboTclHelper_sMakeCString]

    $Titile  GetUserPropStringValue  $lTitlePName $lNameValue

    puts [DboTclHelper_sGetConstCharPtr $lNameValue]
    set pPropValue CHANGED
    set lPageName [DboTclHelper_sMakeCString $pPageName]
    $Titile SetUserPropStringValue $lTitlePName $lPageName

    • Post Points: 20
  • Tue, Nov 27 2012 6:53 AM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,385
    • Points 23,615
    Re: Add tcl script to tcl/tk Application Dashboard Reply
    I am pretty sure that your "proc" is not in the namespace, I reckon you need a "proc ::capTitleBlockEditUtil::EditTitleBlockOnPage" to define the proc. Equally hacking in the supplied files is probably not too great an idea, for example, what happens if "Page" is not active? You might be better of extending the pop-up menu to add your utility since you can be sure what is active when the utility runs. This will also be easier to move around the releases. You can use the orcad_scripting email alias to access "real intelligence" on TCL scripting in Capture.
    • Post Points: 20
  • Tue, Nov 27 2012 7:11 AM

    • vidyutt
    • Not Ranked
    • Joined on Sun, Jan 2 2011
    • Posts 5
    • Points 85
    Re: Add tcl script to tcl/tk Application Dashboard Reply

    Hi, i had written this script just for my demo purposes. For the actual script, i would be searching for all the active designs and their corresponding pages availablein the active session. Also where can i find more information on the "extending the pop-up menu to add your utility".

    • Post Points: 20
  • Tue, Nov 27 2012 12:30 PM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,385
    • Points 23,615
    Re: Add tcl script to tcl/tk Application Dashboard Reply
    Try Chapter 10 of OrCAD_Capture_TclTk_Extensions.pdf, you must have looked in Chapter 11 for the Applications Dashboard stuff...
    • Post Points: 20
  • Tue, Nov 27 2012 11:20 PM

    • vidyutt
    • Not Ranked
    • Joined on Sun, Jan 2 2011
    • Posts 5
    • Points 85
    Re: Add tcl script to tcl/tk Application Dashboard Reply
    Thanks for the info. Really appreciate it.

    I think i would try that out and choose to auto load this tcl script with each new session of Orcad. Thanks again
    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by vidyutt at 27 Nov 2012 05:42 AM. Topic has 4 replies.