• 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. PCB Design
  3. how to use tcl/tk to replace user property

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 165
  • Views 1867
  • Members are here 0
More Content
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to use tcl/tk to replace user property

further
further over 6 years ago

i want to replace all part property "PART_NUBMER" to "Part Number".    

i find "OrCAD Capture TCL/Tk Extensions" may be useful,but i have no idea how to use it.

1 simultaneously manipulate all the parts on a schematic page and add a custom property “PartVersion” with a value of “1.1”,

proc addPropertyToAllPartsOnPage { pPage } {
set lNullObj NULL
set lStatus [DboState]
set pPartInstsIter [$pPage NewPartInstsIter $lStatus]
set pInst [$pPartInstsIter NextPartInst $lStatus]
# iterate over all parts
while {$pInst!=$lNullObj} {
set lPropNameCStr [DboTclHelper_sMakeCString "PartVersion"]
set lPropValueCStr [DboTclHelper_sMakeCString "1.1"]
#add the property to part
set lStatus [$pInst SetEffectivePropStringValue $lPropNameCStr $lPropValueCStr]
set pInst [$pPartInstsIter NextPartInst $lStatus]
}
delete_DboPagePartInstsIter $pPartInstsIter
$lStatus -delete

2 Iterate over all user properties of any object

set lPropsIter [$lObject NewUserPropsIter $lStatus] set lNullObj NULL

#get the first user property on the object

set lUProp [$lPropsIter NextUserProp $lStatus]

while {$lUProp !=$lNullObj } {

#placeholder: do your processing on $lUProp

set lName [DboTclHelper_sMakeCString]

set lValue [DboTclHelper_sMakeCString]

$lUProp GetName $lName

$lUProp GetStringValue

$lValue #get the next user property on the object

set lUProp [$lPropsIter NextUserProp $lStatus]

}

delete_DboUserPropsIter $lPropsIter

  • Cancel
  • further
    further over 5 years ago

    proc addPropertyToAllPartsOnPage { pPage } {
    set lNullObj NULL
    set lStatus [DboState]
    set pPartInstsIter [$pPage NewPartInstsIter $lStatus]
    set pInst [$pPartInstsIter NextPartInst $lStatus]
    # iterate over all parts
    while {$pInst!=$lNullObj} {


    #get PART_NUBMER value
    set lPropNameCStr [DboTclHelper_sMakeCString "PART_NUBMER"]
    set lPartNumber [$pInst GetStringValue $lPropNameCStr]

    #set Part Number
    set lPropValueCStr [DboTclHelper_sMakeCString $lPartNumber]

    #add the property to part
    set lNewPropNameCStr [DboTclHelper_sMakeCString "Part Number"]
    set lStatus [$pInst SetEffectivePropStringValue $lNewPropNameCStr $lPropValueCStr]

    set pInst [$pPartInstsIter NextPartInst $lStatus]
    }
    delete_DboPagePartInstsIter $pPartInstsIter
    $lStatus -delete
    }

    • Cancel
    • Vote Up 0 Vote Down
    • 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