• 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. Set property on FlatNet, using selected Wire in TCL

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 165
  • Views 13100
  • 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

Set property on FlatNet, using selected Wire in TCL

RasmusDK
RasmusDK over 6 years ago

I am writing a TCL script for Capture, and part of the functionality, is that I must be able to set a property on the FlatNet of a Wire selected by the user. I thought that simply setting the property on the Net of the Wire, would be sufficient, but apparently that is not the case. While I am able to set the property, and have it reflected in the FlatNet, there is a twist. Follow these steps:

  1. Open any demo project that has a hierarchy
  2. Source in the script
  3. Select a Wire at the top level
  4. Execute the command ::nsTest::setMyProperty "Top Value"
  5. Observe that the property "MySpecialProperty" has been added, and this is reflected in both the Schematic Nets and the Flat Nets tabs
  6. Descend the hierarchy and select a wire connected to the same FlatNet.
  7. Execute the command ::nsTest::setMyProperty "Bot Value"
  8. Observe that the property "MySpecialProperty" has been changed in the Schematic Nets tab, but the original value ("Top Value") is still present in the Flat Nets tabs.
  9. Ascend the hierarchy and find the first Wire again. Select it.
  10. Execute the command ::nsTest::setMyProperty "My New Top Value"
  11. Observe that the property "MySpecialProperty" has changed, and this is reflected in both the Schematic Nets and the Flat Nets tabs this time

It seems to me that I am not operating on the correct DboObject, in my code. What DboObject should I operate on in order to always get the property reflected in the Flat Net? How do I get to this DboObject from a selected Wire (Wire, Wire_Scalar, Wire_Bus or Wire_Bundle)?

The example script:

# source {C:/Temp/setMyWireProperty.tcl}
# ::nsTest::setMyProperty "Your value goes here"

namespace eval ::nsTest {
}

proc ::nsTest::setMyProperty { pValue } {
set lSelObjs1 [GetSelectedObjects]
set lStatus [DboState]
set lPrpName [DboTclHelper_sMakeCString "MySpecialProperty"]
set lPropValueCStr [DboTclHelper_sMakeCString $pValue]
set gWireTypes [list $::DboBaseObject_WIRE $::DboBaseObject_WIRE_SCALAR $::DboBaseObject_WIRE_BUS $::DboBaseObject_WIRE_BUNDLE]
for {set i 0} {$i<[llength $lSelObjs1]} {incr i} {
set lObj [lindex $lSelObjs1 $i]
set lObjType [DboBaseObject_GetObjectType $lObj]
# Make sure we're dealing with a Wire
if { [lsearch -exact $gWireTypes $lObjType] >= 0 } {
set lNet [$lObj GetNet $lStatus]
set lStatus [$lNet SetEffectivePropStringValue $lPrpName $lPropValueCStr]
}
}
}

  • 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