Home > Community > Forums > PCB Design > Orcad Capture TCL scripting

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: *

 Orcad Capture TCL scripting 

Last post Thu, Jul 17 2014 7:08 PM by Cheeee. 15 replies.
Started by Azef 02 May 2010 12:26 PM. Topic has 15 replies and 12477 views
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts:
  • Sun, May 2 2010 12:26 PM

    • Azef
    • Not Ranked
    • Joined on Sun, May 2 2010
    • Posts 5
    • Points 85
    Orcad Capture TCL scripting Reply

    Hi All,

    I would like to use Orcad Capture TCL scripting. Before the 1st hotfix of 16.3 the command window in Capture echoed all of the operations performed during the editing session. Also .captcl session script log file was available as it is written in the manual. Since 1st and till the 7th hotfix neither command window echo nor .captcl session script log fileare available, and this was my ultimate source of examples.

    What can be done to get both features back? (Apart from uninstalling all of the hotfixes.)

    BTW, I use Win7/64 and tried to run Capture as administrator, if this info may help.

    Best Regards,

    Azef.

    • Post Points: 35
  • Mon, May 3 2010 12:55 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: Orcad Capture TCL scripting Reply

    Hi Azef

    I think the logging option was turned off to increase performance.

    If I remember correct you can turn it on again

    1. View->Toolbar->Command Window

    2. In the command window write "SetOptionBool Journaling TRUE"

    Try this out and let me know if it works out for you (NB: You'll probably have a line with that option set to FALSE in your Capture.ini file.)

    Best regards

    Ole

    Best regards Ole
    • Post Points: 50
  • Mon, May 3 2010 2:01 AM

    • Azef
    • Not Ranked
    • Joined on Sun, May 2 2010
    • Posts 5
    • Points 85
    Re: Orcad Capture TCL scripting Reply

    Hi Ole,

    Thank You very much, Your suggestion works. The capture.ini configuration option is called just "Journaling". After all, it would be good to see all this described in manual.

    Best Regards,

    Azef.

    • Post Points: 5
  • Wed, Aug 18 2010 10:33 AM

    • PCBLady
    • Not Ranked
    • Joined on Mon, Jul 27 2009
    • San Diego, CA
    • Posts 2
    • Points 25
    Re: Orcad Capture TCL scripting Reply

    We are trying to turn off the Input arrows on the schematic that is new with OrCAD 16.3. We have tried the command with no success:

    SetOptionBool  DrawPinArrows  Off

    We get back the following message:

    SetOptionBool <Option> < TRUE | FALSE | ON | OFF | 1 | 0 >. Option can be one of: RotateInstPropInContext ViewerShowPinInfo FlushImmediate Journaling

    It appears this is not a valid command.  

    Any ideas?

     

     

    • Post Points: 20
  • Wed, Aug 18 2010 12:00 PM

    • oldmouldy
    • Top 10 Contributor
    • Joined on Tue, Jul 15 2008
    • Woking, Surrey
    • Posts 1,440
    • Points 24,520
    Re: Orcad Capture TCL scripting Reply

    I think that the option may only have been enabled after applying a hotfix, if you are running a base release, this setting may have no effect. As an alternative, try the Capture.ini file, usually alongside Capture.exe in the installation, close Capture before attacking this, there will be a "DrawPinArrows" entry in there, in the Preferences section, True is the default value, set the text value to False, save the changed file, restart Capture and see if that makes any difference, if not, you may need an update (hotfix) applied.

    • Post Points: 35
  • Wed, Aug 18 2010 3:14 PM

    • PCBLady
    • Not Ranked
    • Joined on Mon, Jul 27 2009
    • San Diego, CA
    • Posts 2
    • Points 25
    Re: Orcad Capture TCL scripting Reply

    Well.....that certainly fixed it after updating with the latest hotfix.

    Thanks for the tip!

    • Post Points: 5
  • Thu, Aug 25 2011 10:37 AM

    • Geoff
    • Top 500 Contributor
    • Joined on Tue, Aug 12 2008
    • Ottawa, Ontario
    • Posts 24
    • Points 390
    Re: Orcad Capture TCL scripting Reply

    I am trying to get into Tcl/Tk   - and it's not going so smoothly!

    Is there anybody still hooked up to this Forum?

     - Geoff

     

    • Post Points: 20
  • Sun, Sep 11 2011 2:04 PM

    • Azef
    • Not Ranked
    • Joined on Sun, May 2 2010
    • Posts 5
    • Points 85
    Re: Orcad Capture TCL scripting Reply

    I'm trying to write some scripts as well, but it takes lots of time since there is lack of documentation. Is anyone aware of some document describing database access functions? I have a specific question, for example: I need to select some wires then access and modify flat nets properties. How do I get to flat net properties whet the object I select is a wire? (I'm managed to get from wire object to net object, but how can I get to the flat net?)

    All the best,

    Azef. 

    • Post Points: 20
  • Sun, Sep 11 2011 7:56 PM

    • paragc
    • Top 500 Contributor
    • Joined on Fri, Dec 4 2009
    • Toronto, Ontario
    • Posts 23
    • Points 295
    Re: Orcad Capture TCL scripting Reply

    You can look at the document in <installation>\tools\capture\tclscripts\OrCAD_Capture_TclTk_Extensions.pdf for examples and description. You can also look at samples in <installation>\tools\capture\tclscripts directory.

    If you are selecting wire on schematic - see GetSelectedObjects command examples in the document.

    Flatnets are calculated by Capture schematic on runtime. Flatnets do not have properties in OrCAD Database. The properties of Flatnets are propogated from the net occurrences. To access the properties at any object see section "3.2.24 Iterate over all  effective  properties of any object".

    Looking at the XML version of the design is one of the best ways to see the structure of the database of your design and to understand which object's property you need to modify to get the desired result. From the TCL command line execute the following command 

    XMATIC_DSN2XML <DSNFilename> <outputXmlName>

    The above command will create an XML output file that shows all the database objects in the design and their relationships.

    The document I have mentioned above has examples of TCL iterators that allow you access to any objects in a design. The Effective property examples in the document show you how to modify properties.

    If you need further help - you can send your questions to orcad_scripting@cadence.com 

     

    • Post Points: 20
  • Sun, Sep 11 2011 10:15 PM

    • Azef
    • Not Ranked
    • Joined on Sun, May 2 2010
    • Posts 5
    • Points 85
    Re: Orcad Capture TCL scripting Reply

    Dear paragc,

    Thank You for the information.

    I used GetSelectedObjects and was able to iterate properties of the wire and then - net, but was unable to get from net level further. From XML export You suggested, I understood that what I need is NetOccurence instead of Flatnet, but I still got a question: how can I get to NetOccurence from NetScalar (or Net)?

    A.

    • Post Points: 20
  • Mon, Sep 12 2011 2:04 AM

    • Kuenga606
    • Not Ranked
    • Joined on Thu, Dec 10 2009
    • Posts 9
    • Points 150
    Re: Orcad Capture TCL scripting Reply

     Hi,

    In the OrCAD_Capture_TclTk_Extensions.pdf, if we search for GetNetOccurrence we find the following:

    GetNetOccurrence(pNet, status) : returns DboNetOccurrence
    Parameters:
    pNet: DboSchematicNet *
    status: DboState &

    The function is of DboInstOccurrence (which is Schematic occurrence) which takes schematic net.

    So for a wire net, we need to get the schematic net and using it we can get the net occurrence

    from the schematic occurrence. Following are the commands:

    # Get the wire object
    set lWire [GetSelectedObjects]
    set lStatus [DboState]
    # Get the Wire Net
    set wireNet [$lWire GetNet $lStatus]
    #Get the Schematic Net for the wire Net
    set lSchNet [$wireNet GetSchematicNet]
    # Get the schematic occurrence
    set schOcc [GetInstanceOccurrence]
     # Get the Net occurrence from the
    # schematic occurrence for a given schematic net
    set lNetOcc [$schOcc GetNetOccurrence $lSchNet $lStatus]

    Thanks

    • Post Points: 35
  • Tue, Nov 15 2011 2:27 PM

    • rob22
    • Not Ranked
    • Joined on Thu, Aug 21 2008
    • Honolulu, HI
    • Posts 1
    • Points 20
    Re: Orcad Capture TCL scripting Reply

    I tried the above example on a sample schematic I had and what I got back confuses me.  I have a net that has the netname "test2" selected and I followed the commands from Kuenga606 and what I got as a response to lNetOcc was "_203f310a_p_DboNetOccurrence".  I assume this is what they call in the TCL/TK Extensions App note a "CString".  I tried running the command

    puts [DboTclHelper_sGetConstCharPtr $lNetOcc]

    and I get back the following

    [    1]No matching function for overloaded 'DboTclHelper_sGetConstCharPtr'

    What does this mean?  How do I see the actual netname "String"?

     

    • Post Points: 20
  • Tue, Nov 15 2011 11:12 PM

    • Kuenga606
    • Not Ranked
    • Joined on Thu, Dec 10 2009
    • Posts 9
    • Points 150
    Re: Orcad Capture TCL scripting Reply

     Hi rob22,

    lNetOcc is the object of class 'class DboNetOccurrence '. This object understands the API listed under 'class DboNetOccurrence' in the PDF 'OrCAD_Capture_TclTk_Extensions.pdf'. To get the name from the object we need to use the following API:

     GetNetName(name) : returns DboState
    Parameters:
    name: CString &

    eg:

    set lCStrObj [DboTclHelper_sMakeCString]

    $lNetOcc GetNetName $lCStrObj

    puts [DboTclHelper_sGetConstCharPtr $lCStrObj]

    To get the flatnet name we need to do the following:

    set lFlatNetObj [$lNetOcc GetFlatNet $lStatus]

    $lFlatNetObj GetName $lCStrObj

    puts [DboTclHelper_sGetConstCharPtr $lCStrObj]

    Thanks

     

    • Post Points: 5
  • Fri, Aug 23 2013 5:27 AM

    • Milos74
    • Not Ranked
    • Joined on Wed, Jul 1 2009
    • Posts 1
    • Points 5
    Re: Orcad Capture TCL scripting Reply

    Hi,

    I am trying to iterate over libaries in CIS and tryng make copy part from existing library to new library with new name. I have difficulites to try proper commands for it.

    To access libary I used these commands:

     

    #to access session
    set lSession $::DboSession_s_pDboSession
    set lStatus [DboState]
    DboSession -this $lSession
    # to access existing library
    set lLibraryPath [DboTclHelper_sMakeCString C:/Cadence/tcl/DISCRETES.OLB]
    set lLib [DboSession_GetLibAndSchematics $lSession $lLibraryPath $lStatus]
    # the iterate via to wanted package...
    set pkgNameIter [$lLib NewPackageNamesIter $lStatus]
    set pPkgName [DboTclHelper_sMakeCString]
    set lStatus [$pkgNameIter NextName $pPkgName]
    # create new library
    set newLib [$lSession CreateLib [DboTclHelper_sMakeCString "C:/Cadence/tcl/test.OLB"] $lStatus] 

    DEADLOCK here... I have no exact imagination of data // commands model and I am unable to copy the part under new name.

    I will appreaciate some guide how to copy part from one olb file to another

    Many thanks in advance.

    Milos 

    • Post Points: 5
  • Thu, Dec 12 2013 10:25 AM

    • Bleslie
    • Not Ranked
    • Joined on Thu, Apr 11 2013
    • Posts 2
    • Points 25
    Re: Orcad Capture TCL scripting Reply

    Typing the above command by itself did not work for me, so I contacted Cadence.  See below for their response:

     

    Please run the following two commands in the TCL shell-

     SetOptionBool Journaling  TRUE

    SetOptionBool DisplayCommands  TRUE

     This should then enable the display of journaling commands n the TCL shell.

     

    Running both the commands worked for me.

    Best Regards

     

    • Post Points: 5
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts:
Started by Azef at 02 May 2010 12:26 PM. Topic has 15 replies.