• 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 use TCL commands to retrieve text content and formatting...

Stats

  • State Not Answered
  • Replies 2
  • Subscribers 13
  • Views 340
  • Members are here 0
More Content

How to use TCL commands to retrieve text content and formatting from a circuit diagram page

FK202606088435
FK202606088435 17 days ago

Hi,

Regarding retrieving the text content and formatting from a circuit page using TCL commands,
I need the text content, text size, font, and font style.

I'd like to ask if there are TCL commands that can extract the same information as in File→Export→Design XML in the following UI interface?

<GraphicCommentTextInst>
<Defn color="48" dbId="1715717" locX="21" locY="19" name="001 COVER PAGE" rotation="0" textJustification="0" x1="21" x2="261" y1="19" y2="47"/>
<TextFont>
<Defn charset="0" escapement="0" height="-27" italic="0" name="Arial" orientation="0" weight="700" width="0"/>
</TextFont>
</GraphicCommentTextInst>

Below is an example of an error I encountered when trying to retrieve font format, text size, and text font:

# Retrieving LOGFONT object index (but pure TCL cannot parse its internal fields)
set lFont [DboGraphicCommentTextInst_sGetFont $lTextInst $lStatus]


Best Regards,

  • Sign in to reply
  • Cancel
  • CadAP
    0 CadAP 17 days ago

    Try below api for text fontsize and fontname.

    DboTclHelper_sMakeLOGFONT(lfFaceName, lfHeight, lfWidth, lfEscapement, lfOrientation,
    lfWeight, lfItalic, lfUnderline, lfStrikeOut,
    lfCharSet, lfOutPrecision, lfClipPrecision,
    lfQuality, lfPitchAndFamily) : returns LOGFONT

    For example, setting text arial and text size 10

        set fntpbj [ DboTclHelper_sMakeLOGFONT "Arial" 16 0 0 0 400 0 0 0 0 7 0 1 16]

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

    Sorry, maybe my question wasn't clear.
    I wanted to capture all the formatting specifications of the text already on the page.
    Although the built-in UI's Export --> XML shows detailed text font specifications, that file is too huge, so I only want to capture the text content.


    This is my failed command:

    set lFont [DboGraphicCommentTextInst_sGetFont $lTextInst $lStatus]

    set lFontFaceName [$lFont cget -lfFaceName]
    set lFontHeight [$lFont cget -lfHeight]
    set lFontSize [expr {abs($lFontHeight)}]
    set lFontWeight [$lFont cget -lfWeight]
    set lFontItalic [$lFont cget -lfItalic]
    set lFontUnderline [$lFont cget -lfUnderline]

    puts $outFile " <TextFont>"
    puts $outFile " <Defn fontName=\"$lFontFaceName\" fontSize=\"$lFontSize\" fontWeight=\"$lFontWeight\" italic=\"$lFontItalic\" underline=\"$lFontUnderline\" />"
    puts $outFile " </TextFont>"

    • 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.

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

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