• 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. how to get a report of not displayed property and make it...

Stats

  • State Verified Answer
  • Replies 4
  • Subscribers 14
  • Views 1270
  • Members are here 0
More Content

how to get a report of not displayed property and make it displayed via TCL script

fSeyer
fSeyer 9 months ago

Hi

How to get all parts specific package and make them display via TCL script?

and any way can generate a report for designator which package are not displayed?

example:

i want to get report of package 0402 resistors which are not displayed and i got options to display one at a time or one by one.

i saw this to code get all 0402 but doesn't work well

set lAllRes [CapFindObjects $COrFindFilterDlg_PARTS {0402*}]
foreach resistor $lAllRes {
UnSelectAll
set res [lindex $resistor 0]
set Id [$res GetId [DboState]]
SelectObjectById $Id
SetDisplayType {Package} {1}
UnSelectAll
}

Thanks

  • Sign in to reply
  • Cancel
  • CadAP
    +1 CadAP 9 months ago

    Hi fSeyer ,

    Please find the below code for your requirement.

    Please do let me know your feedback after trying.

    Please make change for below line if you want to change property name and value.

    For example, below shared code I have filter out Package SIze and Value.

    if {$lPropName == "Package Size" && $lPropValue == "0402"}

    Please copy and paste below code in text file and save it as .tcl.

    set lStatus [DboState]
    set lDesign [GetActivePMDesign]
    set lSchematicIter [$lDesign NewViewsIter $lStatus $::IterDefs_SCHEMATICS]
    #get the first schematic view
    set lView [$lSchematicIter NextView $lStatus]
    set lNullObj NULL
    set lPrpName [DboTclHelper_sMakeCString]
    set lPrpValue [DboTclHelper_sMakeCString]
    set lPrpType [DboTclHelper_sMakeDboValueType]
    set lEditable [DboTclHelper_sMakeInt]
    # set lPropNameCStr [DboTclHelper_sMakeCString "Tolerance"]
    set rotation 0
    set logfont [DboTclHelper_sMakeLOGFONT]
    set lReferenceName [DboTclHelper_sMakeCString]
    set color $::DboValue_DEFAULT_OBJECT_COLOR
    # set displocation [DboTclHelper_sMakeCPoint ]
    UnSelectAll
    while { $lView != $lNullObj} {
    #dynamic cast from DboView to DboSchematic
    set lSchematic [DboViewToDboSchematic $lView]
    #placeholder: do your processing on $lSchematic
    set lPagesIter [$lSchematic NewPagesIter $lStatus]
    #get the first page
    set lPage [$lPagesIter NextPage $lStatus]
    while {$lPage!=$lNullObj} {
    #placeholder: do your processing on $lPage
    set lPartInstsIter [$lPage NewPartInstsIter $lStatus]
    #get the first part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    while {$lInst!=$lNullObj} {
    #dynamic cast from DboPartInst to DboPlacedInst
    set lPlacedInst [DboPartInstToDboPlacedInst $lInst]
    if {$lPlacedInst != $lNullObj} {

    $lPlacedInst GetReference $lReferenceName
    set refdes [DboTclHelper_sGetConstCharPtr $lReferenceName]
    #placeholder: do your processing on $lPlacedInst
    set lPropsIter [$lPlacedInst NewEffectivePropsIter $lStatus]
    #get the first display property on the object

    if {[regexp -nocase {^C} $refdes] == 1} {
    # puts $refdes
    set lDProp [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    while {[$lDProp OK] == 1 } {
    # $lDProp -delete
    set lPropName [DboTclHelper_sGetConstCharPtr $lPrpName]
    set lPropValue [DboTclHelper_sGetConstCharPtr $lPrpValue]
    # puts [DboTclHelper_sGetConstCharPtr $lPrpName]
    if {$lPropName == "Package Size" && $lPropValue == "0402"} {

    puts $lPropName
    puts $lPropValue
    set partId [$lPlacedInst GetId $lStatus]
    SelectObjectById $partId
    # SetDisplayType {Package Size} 1
    set partBBox [$lPlacedInst GetBoundingBox]
    set partleftPointXY [DboTclHelper_sGetCRectTopLeft $partBBox]

    if {[$lPlacedInst GetDisplayProp $lPrpName $lStatus] == $lNullObj } {

    set pNewDispProp [$lPlacedInst NewDisplayProp $lStatus $lPrpName $partleftPointXY $rotation $logfont $color]
    $pNewDispProp SetDisplayType $::DboValue_VALUE_ONLY
    UnSelectAll

    }
    }
    set lDProp [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    }
    delete_DboEffectivePropsIter $lPropsIter
    }
    }
    #get the next part inst
    set lInst [$lPartInstsIter NextPartInst $lStatus]
    }
    delete_DboPagePartInstsIter $lPartInstsIter
    #get the next page
    set lPage [$lPagesIter NextPage $lStatus]
    }
    delete_DboSchematicPagesIter $lPagesIter
    #get the next schematic view
    set lView [$lSchematicIter NextView $lStatus]
    }
    delete_DboLibViewsIter $lSchematicIter

    ZoomOut

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • fSeyer
    0 fSeyer 9 months ago in reply to CadAP

    Hi CadAP,

    The code works as intended, Thank you!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gelzone
    0 Gelzone 16 days ago in reply to CadAP

    CadAP 

    Sorry for bothering, I have tried the code and it worked well except the position of the property name.
    The code:

    set partBBox [$lPlacedInst GetBoundingBox]
    set partleftPointXY [DboTclHelper_sGetCRectTopLeft $partBBox]

    I guess it will make the part has a very large frame and the property name will show at the bottom-right of the frame.
    Can you help to check it out?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • fSeyer
    0 fSeyer 16 days ago in reply to Gelzone

    try to replace with this, you can adjust depend on your reference

    set partBBox [$lPlacedInst GetBoundingBox]
    set lRot [$lPlacedInst GetRotation $lStatus]

    if { $lRot == 0} {
    set partleftPointXY [DboTclHelper_sMakeCPoint 60 -8]
    }
    if { $lRot == 1} {
    set partleftPointXY [DboTclHelper_sMakeCPoint 20 30]
    }

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