• 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. Updating Wire Alias Name as Schematic and Flat Netname

Stats

  • State Not Answered
  • Replies 3
  • Subscribers 12
  • Views 1107
  • Members are here 0
More Content

Updating Wire Alias Name as Schematic and Flat Netname

karthikeyank
karthikeyank 3 months ago

HI,

Im trying to update wire alias name as schematic and flat netname i tired in two different ways, but it remains the same. Can anyone please help me to find the solution.

Program:

SetOptionBool Journaling True

namespace eval WireANameUp {} {
variable dirName [file dirname [info script]]
}

proc WireANameUp::WireANameUpfunc {} {
set lNullObj NULL
set lStatus [DboState]
set lAllWire [GetSelectedObjects]
set name [DboTclHelper_sMakeCString]
set NetName [DboTclHelper_sMakeCString]
foreach lObject $lAllWire {
set lPage [$lObject GetOwner]
set lNet [$lObject GetNet $lStatus]
set lschNet [$lNet GetSchematicNet]
set lAliasIter [$lObject NewAliasesIter $lStatus]
set lAlias [$lAliasIter NextAlias $lStatus]
while { $lAlias!=$lNullObj} {

$lAlias GetName $name
set nameStr [DboTclHelper_sGetConstCharPtr $name]
puts $nameStr

$lschNet GetName $NetName
set NetNameStr [DboTclHelper_sGetConstCharPtr $NetName]
puts $NetNameStr


#$lschNet SetName $name
# NetName is not updating by using above command

set lPropsIter [$lschNet NewEffectivePropsIter $lStatus]
set lPrpName [DboTclHelper_sMakeCString]
set lPrpValue [DboTclHelper_sMakeCString]
set lPrpType [DboTclHelper_sMakeDboValueType]
set lEditable [DboTclHelper_sMakeInt]
set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
while {[$lStatus OK] == 1} {
set NetFilt [DboTclHelper_sGetConstCharPtr $lPrpName]
if {$NetFilt == "Net Name" } {
set Name [DboTclHelper_sGetConstCharPtr $lPrpName]
set Value [DboTclHelper_sGetConstCharPtr $lPrpValue]
puts $Value
set lPropNameCStr [DboTclHelper_sMakeCString $Name]
set lPropValueCStr [DboTclHelper_sMakeCString $nameStr]
set lStatus [$lschNet SetEffectivePropStringValue $lPropNameCStr $lPropValueCStr]
}
set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
}
delete_DboEffectivePropsIter $lPropsIter

set lAlias [$lAliasIter NextAlias $lStatus]
}
DboTclHelper_sEvalPage $lPage
delete_DboWireAliasesIter $lAliasIter
}
}
WireANameUp::WireANameUpfunc

Output:

8__HDIST6F
8RL4A-1_H6_2__SUB-B
8RL4a-1_H6_2__SUB-B

I want to update this name in netname also in flat netname.

  • Cancel
  • Sign in to reply
Parents
  • rg13
    0 rg13 3 months ago

    Hi kartikey,

    While you’re iterating over the properties of the schematic net, I noticed that you’re trying to update the “Net Name” property. Instead, you should be updating the “Name” property of the net object.

    I’ve modified your code accordingly below to reflect this change:

     

    SetOptionBool Journaling True

     

    namespace eval WireANameUp {} {
    variable dirName [file dirname [info script]]
    }

     

    proc WireANameUp::WireANameUpfunc {} {

     

      set lNullObj NULL
      set lStatus [DboState]
      set lAllWire [GetSelectedObjects]
      set name [DboTclHelper_sMakeCString]
      set NetName [DboTclHelper_sMakeCString]
      foreach lObject $lAllWire {
        set lPage [$lObject GetOwner]
        set lNet [$lObject GetNet $lStatus]
        set lschNet [$lNet GetSchematicNet]
        set lAliasIter [$lObject NewAliasesIter $lStatus]
        set lAlias [$lAliasIter NextAlias $lStatus]

        while {$lAlias!=$lNullObj} {

     

          $lAlias GetName $name
          set nameStr [DboTclHelper_sGetConstCharPtr $name]
          # puts $nameStr

     

          $lschNet GetName $NetName
          set NetNameStr [DboTclHelper_sGetConstCharPtr $NetName]
          # puts $NetNameStr

     

          # $lschNet SetName $name
          # NetName is not updating by using above command

     

        set lPropsIter [$lschNet NewEffectivePropsIter $lStatus]
        set lPrpName [DboTclHelper_sMakeCString]
        set lPrpValue [DboTclHelper_sMakeCString]
        set lPrpType [DboTclHelper_sMakeDboValueType]
        set lEditable [DboTclHelper_sMakeInt]
        set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]

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

        set NetFilt [DboTclHelper_sGetConstCharPtr $lPrpName]
            if {$NetFilt == "Name"} {

            set NameProp [DboTclHelper_sMakeCString "Name"]
            $lschNet SetEffectivePropStringValue $NameProp $name

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

     

      set lAlias [$lAliasIter NextAlias $lStatus]
      }
      DboTclHelper_sEvalPage $lPage
      delete_DboWireAliasesIter $lAliasIter
      }
    }

    WireANameUp::WireANameUpfunc

     

    Hope it helps!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • rg13
    0 rg13 3 months ago

    Hi kartikey,

    While you’re iterating over the properties of the schematic net, I noticed that you’re trying to update the “Net Name” property. Instead, you should be updating the “Name” property of the net object.

    I’ve modified your code accordingly below to reflect this change:

     

    SetOptionBool Journaling True

     

    namespace eval WireANameUp {} {
    variable dirName [file dirname [info script]]
    }

     

    proc WireANameUp::WireANameUpfunc {} {

     

      set lNullObj NULL
      set lStatus [DboState]
      set lAllWire [GetSelectedObjects]
      set name [DboTclHelper_sMakeCString]
      set NetName [DboTclHelper_sMakeCString]
      foreach lObject $lAllWire {
        set lPage [$lObject GetOwner]
        set lNet [$lObject GetNet $lStatus]
        set lschNet [$lNet GetSchematicNet]
        set lAliasIter [$lObject NewAliasesIter $lStatus]
        set lAlias [$lAliasIter NextAlias $lStatus]

        while {$lAlias!=$lNullObj} {

     

          $lAlias GetName $name
          set nameStr [DboTclHelper_sGetConstCharPtr $name]
          # puts $nameStr

     

          $lschNet GetName $NetName
          set NetNameStr [DboTclHelper_sGetConstCharPtr $NetName]
          # puts $NetNameStr

     

          # $lschNet SetName $name
          # NetName is not updating by using above command

     

        set lPropsIter [$lschNet NewEffectivePropsIter $lStatus]
        set lPrpName [DboTclHelper_sMakeCString]
        set lPrpValue [DboTclHelper_sMakeCString]
        set lPrpType [DboTclHelper_sMakeDboValueType]
        set lEditable [DboTclHelper_sMakeInt]
        set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]

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

        set NetFilt [DboTclHelper_sGetConstCharPtr $lPrpName]
            if {$NetFilt == "Name"} {

            set NameProp [DboTclHelper_sMakeCString "Name"]
            $lschNet SetEffectivePropStringValue $NameProp $name

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

     

      set lAlias [$lAliasIter NextAlias $lStatus]
      }
      DboTclHelper_sEvalPage $lPage
      delete_DboWireAliasesIter $lAliasIter
      }
    }

    WireANameUp::WireANameUpfunc

     

    Hope it helps!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • karthikeyank
    0 karthikeyank 3 months ago in reply to rg13

    HI, Thanks for the reply...

    Still remains the same not updated.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP 3 months ago in reply to karthikeyank

     karthikeyank 

    DO you have access to ASK portal, if yes please contact us with your design else will connect through different channel.

    • 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