• 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 do I use the TCL command to save an image and a Visio...

Stats

  • State Verified Answer
  • Replies 3
  • Subscribers 13
  • Views 563
  • Members are here 0
More Content

How do I use the TCL command to save an image and a Visio drawing file from a DSN file as a new file?

FK202606088435
FK202606088435 1 month ago

Hi,

My current version is 23.1. How do I use the TCL command to save an image and a Visio drawing file from a DSN file as a new file?

I've tried the Base64 decoding mentioned on pages 762 and 767 of the OrCAD_Capture_TclTk_Extensions.pdf file, but it's not working. The code snippet provided is:

Invalid command name "DboTclHelper_sGetBase64ImageData"

  • Sign in to reply
  • Cancel

Top Replies

  • TechnoBobby
    TechnoBobby 1 month ago +1 verified
    Hi FK202606088435 , Please try the following TCL code on a selected image on schematic page: set bmpInst [GetSelectedObjects] set bmp [$bmpInst GetDboBitMap] set outStr [DboTclHelper_sMakeStdStr ""] set…
Parents
  • TechnoBobby
    +1 TechnoBobby 1 month ago

    Hi FK202606088435 ,

    Please try the following TCL code on a selected image on schematic page:

    set bmpInst [GetSelectedObjects]
    set bmp [$bmpInst GetDboBitMap]

    set outStr [DboTclHelper_sMakeStdStr ""]
    set status [DboState]

    DboBitMap_sGetBase64ImageData $bmp $outStr $status

    set base64Data [DboTclHelper_sGetConstCharPtr $outStr]

    COrBase64Encoder_decodeToFile $base64Data "c:/temp/image.png"

    Hope this helps!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • TechnoBobby
    +1 TechnoBobby 1 month ago

    Hi FK202606088435 ,

    Please try the following TCL code on a selected image on schematic page:

    set bmpInst [GetSelectedObjects]
    set bmp [$bmpInst GetDboBitMap]

    set outStr [DboTclHelper_sMakeStdStr ""]
    set status [DboState]

    DboBitMap_sGetBase64ImageData $bmp $outStr $status

    set base64Data [DboTclHelper_sGetConstCharPtr $outStr]

    COrBase64Encoder_decodeToFile $base64Data "c:/temp/image.png"

    Hope this helps!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • FK202606088435
    0 FK202606088435 24 days ago in reply to TechnoBobby

    Nice solution! Thank you very much.

    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]

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • TechnoBobby
    0 TechnoBobby 17 days ago in reply to FK202606088435

    Hi FK202606088435 ,

    To retrieve the text content, you can try:

    set lObjs [GetSelectedObjects]
    set lComment [$lObj GetDboCommentText]
    set txt [DboTclHelper_sMakeCString]
    $lComment GetText $txt
    puts "Text: [DboTclHelper_sGetConstCharPtr $txt]"

    You can also iterate through the effective properties of the selected text object which will return text, bounding box, font name, etc:

    proc EffectivePropsAll {lObject} {
    set lStatus [DboState]
    set lPropsIter [$lObject 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} {
    puts "[DboTclHelper_sGetConstCharPtr $lPrpName] = [DboTclHelper_sGetConstCharPtr $lPrpValue]"
    set lStatus [$lPropsIter NextEffectiveProp $lPrpName $lPrpValue $lPrpType $lEditable]
    }
    delete_DboEffectivePropsIter $lPropsIter
    }

    EffectivePropsAll [GetSelectedObjects]

    Hope this helps!

    • 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