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

    I see varying results. It may be my eyes but I don't see bolding in 17.2.

    It appears that the interpretation of HTML content just requires the first character of the text file to be a "<" in 17.2.

    I'm still waiting for a response to my service request.

    16.6:

    17.2:

    defun( testHTML2 ()
    let((p)
    p = axlDMOpenLog("aaa")
    when(p
    ;fprintf(p, "<>The quick brown fox at (0.0 0.0) ...\n")
    fprintf(p, "<font color=\"red\">This is red text.</font>\n")
    fprintf(p, "<font color=\"red\">FAILED :HEADER WITH CORRECT DATA ELEMENT BUT INCORRECT DATA TYPE.</font>\n")
    fprintf(p, "<b><font color=\"red\">FAILED :HEADER WITH CORRECT DATA ELEMENT BUT INCORRECT DATA TYPE. (BOLD)</font></b>\n")
    fprintf(p, "<font color=\"green\">This is green text.</font>\n")
    fprintf(p, "<b><font color=\"green\">This is bold green text.</font></b>\n")
    fprintf(p, "<b><font color=\"red\">This is bold red text.</font></b>\n")
    fprintf(p, "<font color=\"red\">This is red text</font>\n")
    drain(p)
    axlDMClose(p)
    axlUIViewFileCreate("aaa.log", "Sample2", nil)
    )
    ))

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

    I see varying results. It may be my eyes but I don't see bolding in 17.2.

    It appears that the interpretation of HTML content just requires the first character of the text file to be a "<" in 17.2.

    I'm still waiting for a response to my service request.

    16.6:

    17.2:

    defun( testHTML2 ()
    let((p)
    p = axlDMOpenLog("aaa")
    when(p
    ;fprintf(p, "<>The quick brown fox at (0.0 0.0) ...\n")
    fprintf(p, "<font color=\"red\">This is red text.</font>\n")
    fprintf(p, "<font color=\"red\">FAILED :HEADER WITH CORRECT DATA ELEMENT BUT INCORRECT DATA TYPE.</font>\n")
    fprintf(p, "<b><font color=\"red\">FAILED :HEADER WITH CORRECT DATA ELEMENT BUT INCORRECT DATA TYPE. (BOLD)</font></b>\n")
    fprintf(p, "<font color=\"green\">This is green text.</font>\n")
    fprintf(p, "<b><font color=\"green\">This is bold green text.</font></b>\n")
    fprintf(p, "<b><font color=\"red\">This is bold red text.</font></b>\n")
    fprintf(p, "<font color=\"red\">This is red text</font>\n")
    drain(p)
    axlDMClose(p)
    axlUIViewFileCreate("aaa.log", "Sample2", 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