Quantcast
Channel: Cadence PCB Design Forum
Viewing all articles
Browse latest Browse all 5525

how to use tcl/tk to replace user property

$
0
0

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


Viewing all articles
Browse latest Browse all 5525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>