• 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 - Skill
  3. Need your help on Highlight the error location in report...

Stats

  • Replies 4
  • Subscribers 18
  • Views 10331
  • Members are here 0
More Content

Need your help on Highlight the error location in report.

Ragavan T
Ragavan T over 6 years ago

Dear All,
I am a CAD Librarian, wishes to learn skill programming to check the footprint parameters, like line width and package height, and design unit. for the first attempt, I started to code for checking line width of assembly outline, and also need to report an error in case of line width not as per standard. code inserted below, To enhance this code if in case of a width not as per standard it supposed to report error location.

axlCmdRegister("assycheck" 'asscheck)
defun( asscheck ()
let((allLines, ends)
l_tmp = axlDBGetDesignUnits()
unit = nth(0 l_tmp)
;printf("Units are in %L\n", unit)
axlVisibleDesign(nil)
axlVisibleLayer("PACKAGE GEOMETRY/ASSEMBLY_TOP" t)
axlSetFindFilter(?enabled list("noall" "Lines") ?onButtons list("noall" "Lines"))
allLines = axlGetSelSet(axlAddSelectAll())
axlClearSelSet()
i_tmp = list()
p = axlDMOpenLog("REPORT")
    
    foreach(line, allLines
        foreach(segment, line ->segments
            ends = segment ->width

            if(unit == "millimeters" && ends != 0.0254 then
                i_tmp = cons(end i_tmp)
            )
            if(unit == "mils" && ends != 1.00 then
                i_tmp = cons(end i_tmp)
            )
        );end foreach segment
    );end foreach line
        
        if(length(i_tmp) == 0 then
            fprintf(p, "Units are in %L\n\n", unit)
            fprintf(p, "ASSEMBLY LINE WIDTH IS OK\n", end)
        )
        if(length(i_tmp) > 0 then
            ;printf("ERRORS\n", end)
            fprintf(p, "Units are in %L\n\n", unit)
            fprintf(p, "ERROR:ALL ASSEMBLY LINE WIDTH ARE NOT AS PER STANDARD.\n\n", end)
        )

    axlDMClose(p)
    axlUIViewFileCreate("REPORT.log" sprintf(nil, "REPORT", end), nil)
);end let
axlVisibleDesign(t)
axlMsgPut("Checking completed.See Report.")
);end defun

Thanks in advance

Regards,

Ragavan Thangaraj

CAD Libararian

  • Cancel
  • Sign in to reply
Parents
  • Jason Hsu
    Jason Hsu over 6 years ago

    Hi Ragavan,

      You can use axlHighLightObject(obj), axlZoomToDbid(obj t) to highlight the line that width doesn't equal 0.0254 or 1. After use axlUIConfirm(), dehighlight the object to use axlDehighlightObject(obj). It will be more clear on allegro window than log file. I think : )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • RagavanT
    RagavanT over 6 years ago in reply to Jason Hsu

    I tried and failed to get the exact output, and don't know how to use it. as a new to skill to skill programming. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Jason Hsu
    Jason Hsu over 6 years ago in reply to RagavanT

    Just a sample.


        when( car(axlDBGetDesignUnits()) == "millimeters"   line_width = 0.1524 )
        when( car(axlDBGetDesignUnits()) == "mils"          line_width = 6.0)

        axlClearSelSet()
        axlVisibleDesign(nil)
        axlVisibleLayer("Package Geometry/Silkscreen_Top" t )
        axlVisibleUpdate(nil)
        axlSetFindFilter(?enabled list( "noall" "lines") ?onButtons list( "noall" "lines))
        axlAddSelectAll()


        allLine = axlGetSelSet()
        foreach( line allLine
            foreach( segment line->segments
                 width = segment ->width
                 if( width == line_width then
                     fprintf(AMC_LOG "PASSED: The line width is %L on\"Package Geometry/Silkscreen_Top\".\n" width)
                 else
                      startEnd = car(line ->segments)->startEnd

                      axlHighlightObject(segment)
                      axlZoomToDbid(segment t)
                      axlUIConfirm(sprintf(nil "The line width is %L on \"Package Geometry/Silkscreen_Top\", should be %L\n" width line_width))
                      axlDehighlightObject(segment)
                      fprintf(AMC_LOG "FAILED: The line width is %L on \"Package Geometry/Silkscreen_Top\" at %L, should be %L\n" width startEnd line_width)

                      results->errors = results->errors + 1
                  )
              )
          )
          
                   

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Jason Hsu
    Jason Hsu over 6 years ago in reply to RagavanT

    Just a sample.


        when( car(axlDBGetDesignUnits()) == "millimeters"   line_width = 0.1524 )
        when( car(axlDBGetDesignUnits()) == "mils"          line_width = 6.0)

        axlClearSelSet()
        axlVisibleDesign(nil)
        axlVisibleLayer("Package Geometry/Silkscreen_Top" t )
        axlVisibleUpdate(nil)
        axlSetFindFilter(?enabled list( "noall" "lines") ?onButtons list( "noall" "lines))
        axlAddSelectAll()


        allLine = axlGetSelSet()
        foreach( line allLine
            foreach( segment line->segments
                 width = segment ->width
                 if( width == line_width then
                     fprintf(AMC_LOG "PASSED: The line width is %L on\"Package Geometry/Silkscreen_Top\".\n" width)
                 else
                      startEnd = car(line ->segments)->startEnd

                      axlHighlightObject(segment)
                      axlZoomToDbid(segment t)
                      axlUIConfirm(sprintf(nil "The line width is %L on \"Package Geometry/Silkscreen_Top\", should be %L\n" width line_width))
                      axlDehighlightObject(segment)
                      fprintf(AMC_LOG "FAILED: The line width is %L on \"Package Geometry/Silkscreen_Top\" at %L, should be %L\n" width startEnd line_width)

                      results->errors = results->errors + 1
                  )
              )
          )
          
                   

    • 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