• 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. Editing title block field manually breaks script

Stats

  • State Verified Answer
  • Replies 3
  • Subscribers 12
  • Views 1018
  • Members are here 0
More Content

Editing title block field manually breaks script

Mhawley1
Mhawley1 2 months ago

So this is interesting , in trying to make my auto rev script for flat and hierarchical schematic I noticed something interesting . If you manually edit the properties in "yellow" then the field can no longer be read or edited by code . Or at least I dont have a clear path to edit it . See video if it helps 

  • Cancel
  • Sign in to reply
  • TechnoBobby
    0 TechnoBobby 2 months ago

    Hi Mhawley1 ,

    You might currently be iterating only through the title blocks, which means you’re working with DboTitleBlock objects. Editing from this directly modifies only the instance-level properties.

    That’s why when you manually edit the occurrence properties (shown in yellow), it doesn’t reflect in your script if you’re not accessing the correct occurrence.

    In a previous post, we discussed iterating over occurrences of the title block (which gives you DboOccurrence objects). That method allows you to properly access and edit occurrence-level properties.

    If you’d like to handle both cases — where occurrences exist or not — here’s a small proc you can use to fetch all title block occurrences (DboOccurrence) from a given parent (DboTitleBlock):

    proc lGetOcc {lParent} {
      set lPartOcc {}
        set lOccCount [$lParent GetOccurrencesCount]
        for {set i 0} {$i<$lOccCount} {incr i} { 
            set lOcc [$lParent GetOccurrencesAtPos $i]
            lappend lPartOcc $lOcc
        }
      return $lPartOcc
    }

    You can then check if occurrences exist for the title block. If they do, modify the properties on those occurrences as well. If they don’t, fall back to editing directly instance level property.

    Hope this helps!

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • Mhawley1
    0 Mhawley1 2 months ago in reply to TechnoBobby

    Short reply , THIS WORKED ! I need to clean up my solution a little and ill repost in about an hour . Also thank you for the help . Your code snippets are small and to the point , they allow me to "INJECT" that right into my code and fix the issue. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Mhawley1
    0 Mhawley1 2 months ago in reply to TechnoBobby

    Ok so this is the code I settled on , Just added these procedures when each title block object comes up over the iteration . 

    proc change_occurence_title {title_examined new_rev_code} {


    set strange_occurent [lGetOcc $title_examined]

    set new_rev [DboTclHelper_sMakeCString $new_rev_code]


    set lProp [DboTclHelper_sMakeCString "RevCode"]
    set lname [DboTclHelper_sMakeCString]


    foreach occ $strange_occurent {

    $occ GetEffectivePropStringValue $lProp $lname

    set lStatus [$occ SetEffectivePropStringValue $lProp $new_rev]
    }

    }


    proc lGetOcc {lParent} {
    set lPartOcc {}
    set lOccCount [$lParent GetOccurrencesCount]
    for {set i 0} {$i<$lOccCount} {incr i} {
    set lOcc [$lParent GetOccurrencesAtPos $i]
    lappend lPartOcc $lOcc
    }

    return $lPartOcc
    }

    • 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