• 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. TCL script for creating library, drawing rectangle and placing...

Stats

  • State Not Answered
  • Replies 1
  • Subscribers 13
  • Views 179
  • Members are here 0
More Content

TCL script for creating library, drawing rectangle and placing pins, and saving .OLB

AT202409242847
AT202409242847 5 days ago

Hello,

Currently I want an autoLoad TCL script that does the following

1. creates a new library and part

2. draws rectangle and some pins

3. exports to .OLB 

I tried copying command journaling to get this:

```

set libDir "C:/Users/.../AppData/Roaming/SPB_Data/cdssetup/workspace/libraries/symbols"
set libPath "$libDir/LIBRARY1.OLB"
set outputPath "C:/syscap/output/test.olb"
set partName "TEST"


Menu "File::New::Library"

SelectPMItem "$libPath"

capLaunchNewSymbolEditor "$libPath" "$partName" 1 1

OrSymbolEditor::execute placeRectangle -0.4 0.7 0.4 -0.7

OrSymbolEditor::execute placeSymbolPin {OUT} {1} 2 Line {} -0.4 0.3 -0.5 0.3 true Scalar {{"UserPropAr":[]}}

OrSymbolEditor::execute placeSymbolPin {IN+} {3} 0 Line {} -0.4 0 -0.5 0 true Scalar {{"UserPropAr":[]}}

# Save library to output path
MenuCommand "29596" | FileDialog "OK" "$outputPath" 1
OrSymbolEditor::execute save 0
```

However, it fails on startup autoLoad with the Menu command giving MenuID not found. Which I assume is due to the script being run before the ui is initialized? Pasting the command into the command window manually works no issue...

I tried looking up how to do this using the Dbo commands, but only got as far as something like this:

```

set lSession $::DboSession_s_pDboSession
set lStatus [DboState]
DboSession -this $lSession

set newLib [$lSession CreateLib [DboTclHelper_sMakeCString "C:/syscap/output/test.OLB"] $lStatus] 

set lLibraryPath [DboTclHelper_sMakeCString C:/syscap/output/test.OLB]
set lLib [DboSession_GetLibAndSchematics $lSession $lLibraryPath $lStatus]

```

If anybody could let me know how to run the script on startup without the menu issue or draft a TCL script for what I want to do, that would be greatly appreciated!

Many thanks in advance!

  • Cancel
  • Sign in to reply
Parents
  • CadAP
    0 CadAP 2 days ago

    AT202409242847  

    Try the below suggestion if it helps:

    Load your tcl code after few secs(use after command)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • CadAP
    0 CadAP 2 days ago

    AT202409242847  

    Try the below suggestion if it helps:

    Load your tcl code after few secs(use after command)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information