• 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. TCL to change Implementation Type to none for all parts...

Stats

  • State Verified Answer
  • Replies 21
  • Answers 1
  • Subscribers 15
  • Views 6533
  • Members are here 0
More Content

TCL to change Implementation Type to none for all parts in a library

Jim OMahony
Jim OMahony over 1 year ago

We are experiencing the problem "QUESTION(ORCAP-1730): File is in use by other user. Want to open (library file .OLB) in ReadOnly mode?" described in the trouble shooting article

https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1O3w000009fyoXEAQ&pageName=ArticleContent

This article recommends changing all non hierarchical parts "Implementation Type" properties from "Schematic" to "None".

Could the  script prop_mod.tcl from troubleshooting article https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nYBdEAM&pageName=ArticleContent

be modified change this value instead of simply adding or removing properties ?

  • Sign in to reply
  • Cancel
  • CadAP
    0 CadAP over 1 year ago

    Hi Jim,

    Please copy paste the below tcl code in a text editor and save as imptypepropupdate.tcl.


    Then open Orcad capture and source the tcl file and type command updateLibraryPropVal <path_of_olb>

    For example

    updateLibraryPropVal C:/Cadence/CAP.OLB , where CAP.OLB is library on which we want to update the "Implementation Type" property value to "None" for all parts/symbols.

    After running the above tcl Implementation Type property value will be changed to "None" for all packages(parts/symbol) available in the source library.

    proc updateLibraryPropVal {lLibPath} {

    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession

    set lStatus [DboState]

    set lSourceOlb [file normalize $lLibPath]
    set lIndex [string last "/" $lSourceOlb]
    set lOlbName [string range $lSourceOlb [expr ($lIndex + 1) ] end ]

    set pPkgNameCString [DboTclHelper_sMakeCString]

    set pLibName [DboTclHelper_sMakeCString $lSourceOlb]
    Menu "File::Open::Library" OrSymbolEditor::TabActivate "" "" | FileDialog "OK" "$lSourceOlb" 1OrSymbolEditor::TabActivate "" ""

    set lLib [$lSession GetLib $pLibName $lStatus]

    set lPackageNameIter [$lLib NewPackageNamesIter $lStatus]
    set lStatus [$lPackageNameIter NextName $pPkgNameCString]
    set lStatusVal [$lStatus Failed]


    while {$lStatusVal != 1} {

    set pPakgName [DboTclHelper_sGetConstCharPtr $pPkgNameCString]
    # puts $pPakgName
    SelectPMItem "$pPakgName"
    MenuCommand "2147" capLaunchNewSymbolEditor "C:/CADENCE/CAP.OLB" "$pPakgName" 0 1
    OrSymbolEditor::execute setLibPartProp {[{"nm":"Implementation Type","val":"None"}]}
    # capLaunchNewSymbolEditor "$lSourceOlb" "$pPakgName" 0 1
    Menu "File::Save"
    OrSymbolEditor::TabActivate "$lSourceOlb" "$pPakgName"
    MenuCommand "57927" OrSymbolEditor::TabActivate "$lSourceOlb" "$pPakgName"
    set lStatus [$lPackageNameIter NextName $pPkgNameCString]
    set lStatusVal [$lStatus Failed]

    }

    delete_DboLibPackageNamesIter $lPackageNameIter
    SelectPMItem "./$lOlbName"

    Menu "File::Save"

    }

    Hope this helps!

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

    Hi, this script works to an extent but I had to add the line

    OrSymbolEditor::execute setLibPartProp {[{"nm":"Implementation","val":""}]}

    ahead of the line

    OrSymbolEditor::execute setLibPartProp {[{"nm":"Implementation Type","val":"None"}]}

    otherwise if "Implementation" is not empty the "Implementation Type" will not change.

    The script works very slowly opening each part before changing it. That might be ok but Orcad has
    crashed twice before finishing.

    I am now wondering if there is a way to list the properties in each part in a library to see which ones have
    an" Implementation Type" of "Schematic" ? Export properties does not list this.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    +1 CadAP over 1 year ago in reply to Jim OMahony

    Hi Jim,

    Thanks for your feedback.

    Please use the below tcl code to get the library part with Implementation Type <none> you can change it to "schematic" at below line 

    if {$lPropValue == "<none>"}


    #provide the .OLB loaction with name.
    set libpath {C:/Cadence/LIBRARY2.OLB}

    set lLibPathCs [DboTclHelper_sMakeCString $libpath]
    set lSession $::DboSession_s_pDboSession
    DboSession -this $lSession
    set lStatus [DboState]
    set lNullObj NULL
    set lDboLibrary [DboSession_GetLib $lSession $lLibPathCs $lStatus]
    # puts $lDboLibrary
    set lPartIter [$lDboLibrary NewPartsIter $lStatus]
    set lPart [$lPartIter NextPart $lStatus]
    # puts $lsymbl
    while {$lPart!=$lNullObj} {

    set lPrpName [DboTclHelper_sMakeCString]
    set lPrpValue [DboTclHelper_sMakeCString]
    set lPrpType [DboTclHelper_sMakeDboValueType]
    set lEditable [DboTclHelper_sMakeInt]
    set lPropsIter [$lPart NewEffectivePropsIter $lStatus]
    #get the first effective property
    set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    while {[$lStatus OK] == 1} {

    #get the next effective property
    set lPropValue [DboTclHelper_sGetConstCharPtr $lPrpValue]
    set lPropName [DboTclHelper_sGetConstCharPtr $lPrpName]
    if {$lPropValue == "<none>"} {
    # puts $lPropName
    set pActualsymName [DboTclHelper_sMakeCString]
    $lPart GetName $pActualsymName
    puts [DboTclHelper_sGetConstCharPtr $pActualsymName]

    }
    set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    }
    delete_DboEffectivePropsIter $lPropsIter

    set lPart [$lPartIter NextPart $lStatus]
    }
    delete_DboLibPartsIter $lPartIter

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • Jim OMahony
    0 Jim OMahony over 1 year ago in reply to CadAP

    The script works with the value "<none>" however neither the value "<schematic>" nor "<Schematic View>" gives any results. "<Schematic View>" is what appears in the command window when the Implementation Type is changed manually.

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

    Hi Jim,

     I think here you are trying to run the above tcl code for schematic placed parts. The above  script will work if the property implementation is modified at library level, not at schematic level.

    For schematic level please use the tcl script below. It works to identify the parts which have property value. Implementation Type "Schematic View"

    set lAllParts [CapFindObjects $COrFindFilterDlg_PARTS {*}]

    foreach lPart $lAllParts {

    set lPrpName [DboTclHelper_sMakeCString]
    set lPrpValue [DboTclHelper_sMakeCString]
    set lPrpType [DboTclHelper_sMakeDboValueType]
    set lEditable [DboTclHelper_sMakeInt]
    set lPropsIter [$lPart NewEffectivePropsIter $lStatus]
    #get the first effective property
    set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]

    while {[$lStatus OK] == 1} {

    #get the next effective property
    set lPropValue [DboTclHelper_sGetConstCharPtr $lPrpValue]
    set lPropName [DboTclHelper_sGetConstCharPtr $lPrpName]
    # puts $lPropValue
    if {$lPropValue == "Schematic View"} {
    # puts $lPropName
    set pActualsymName [DboTclHelper_sMakeCString]
    $lPart GetName $pActualsymName
    puts [DboTclHelper_sGetConstCharPtr $pActualsymName]

    }
    set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    }
    delete_DboEffectivePropsIter $lPropsIter

    }

    Please make sure your are selecting the open  <project_name>.dsn in the capture before sourcing the tcl.

    • Cancel
    • Vote Up +1 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