• 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 PCB Editor
  3. How to color a string using SKill

Stats

  • Replies 11
  • Subscribers 159
  • Views 20291
  • Members are here 0
More Content

How to color a string using SKill

JerryWilson
JerryWilson over 8 years ago

Hi Dave, all

I have a code to check footprint prints in our library. In my code i will output it into a log file called MCL log file. 

In the code i have pass/fail messages in which for pass messages, i want to color it green & fail message as red.

How do i do that. Below is a portion of the code.Hope anyone can help.

Thanks

JerryWilson

defun( _mcl_start ()

let((errors overallerrors)
overallerrors=0

mcl_log.log=axlDMOpenLog("mcl")

fprintf(mcl_log.log " MCL CHECK LOG ............................... Created:")

Date=(getCurrentTime)
fprintf(mcl_log.log "%s\n\n" Date)

axlDBGetDesignUnits()

fprintf(mcl_log.log "\n-----------------------------CHECK DRAWING PARAMETERS----------------------------\n")


errors=0
let((y m p)
y = axlGetParam('paramDesign)
if(y->units=="millimeters" then
;fprintf(mcl_log.log "\nPASSED :USER UNITS." )

else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID USER UNITS., %s" y->units)
)
if(y->accuracy==3 then
;fprintf(mcl_log.log "\nPASSED :ACCURACY." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID ACCURACY., %d" y->accuracy)
)
if(y->height==210 then
;fprintf(mcl_log.log "\nPASSED :DRAWING EXTENT HEIGHT." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID DRAWING EXTENT HEIIGHT., %f" y->height)
)
if(y->width==297 then
;fprintf(mcl_log.log "\nPASSED :DRAWING EXTENT WIDTH." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID DRAWING EXTENT WIDTH., %f" y->width)
)
if(y->xy==list(-150 -105) then
;fprintf(mcl_log.log "\nPASSED :DRAWING EXTENT LOWER X AND LOWER Y." )
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID DRAWING EXTENT LOWER X AND LOWER Y., %P\n" y->xy)
)
m = axlDesignType(t)
if( or( m=="PACKAGE" m=="SHAPE" m=="FLASH" ) then
;fprintf(mcl_log.log "\nPASSED :SYMBOL TYPE., %s\n" m)
else
errors++
overallerrors++
fprintf(mcl_log.log "\nFAILED :INVALID SYMBOL TYPE., %s\n" m)
)

if(errors==0 then
fprintf(mcl_log.log "\n\t%d ERROR(S) ON DRAWING PARAMETERS SETTINGS.\n", errors)
else
fprintf(mcl_log.log "\n\t%d ERROR(S) ON DRAWING PARAMETERS SETTINGS\n", errors)
)
;fprintf(mcl_log.log "***CHECK DRAWING PARAMETERS-END*****\n\n")
)

  • Cancel
  • Sign in to reply
Parents
  • eDave
    eDave over 8 years ago

    defun( _testHTML ()
    let((p)
    p = axlDMOpenFile("ALLEGRO_HTML", "aaa.log", "w")
    when(p
    fprintf(p, "<!DOCTYPE html>\n")
    fprintf(p, "<html>\n")
    fprintf(p, "<body>\n")
    fprintf(p, "The quick brown ...<Br>\n")
    fprintf(p, "<font color=\"red\">This is red text.</font>\n")
    fprintf(p, "</body>\n")
    fprintf(p, "</html>\n")
    drain(p)
    axlDMClose(p)
    )
    axlUIViewFileCreate("aaa.log", "Sample", nil)
    ))

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • eDave
    eDave over 8 years ago

    defun( _testHTML ()
    let((p)
    p = axlDMOpenFile("ALLEGRO_HTML", "aaa.log", "w")
    when(p
    fprintf(p, "<!DOCTYPE html>\n")
    fprintf(p, "<html>\n")
    fprintf(p, "<body>\n")
    fprintf(p, "The quick brown ...<Br>\n")
    fprintf(p, "<font color=\"red\">This is red text.</font>\n")
    fprintf(p, "</body>\n")
    fprintf(p, "</html>\n")
    drain(p)
    axlDMClose(p)
    )
    axlUIViewFileCreate("aaa.log", "Sample", nil)
    ))

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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.

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

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