• 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. I Need Help Creating a Shape With a Void on Route Keepout...

Stats

  • State Suggested Answer
  • Replies 4
  • Answers 1
  • Subscribers 18
  • Views 360
  • Members are here 0
More Content

I Need Help Creating a Shape With a Void on Route Keepout in Allegro

MarkGorecki
MarkGorecki 23 days ago

Hello,

I followed the instructions in the Allegro X PCB Editor Skill Programming Language course, but it seems to be missing something.

Shown below is my code to create a rectangular shape, with rounded corners, then add a void, also with rounded corners, to that shape.

procedure(CreateHSKO_Callback(formStatus)
let( (lidX lidY cavityX cavityY lidType lidRadius lidCham cavRadius
lidX1 lidX2 lidX3 lidX4 lidY1 lidY2 lidY3 lidY4 chamX chamY cavX1 cavX2 cavX3 cavX4
cavY1 cavY2 cavY3 cavY4 hsPath voidPath)
lidX = 0
lidY = 0
cavityX = 0
cavityY = 0
lidType = nil
lidRadius = 0
lidCham = 0
cavRadius = 0
lidX1 = 0
lidX2 = 0
lidX3 = 0
lidX4 = 0
lidY1 = 0
lidY2 = 0
lidY3 = 0
lidY4 = 0
chamX = 0
chamY = 0
cavX1 = 0
cavX2 = 0
cavX3 = 0
cavX4 = 0
cavY1 = 0
cavY2 = 0
cavY3 = 0
cavY4 = 0
hsPath = 0
voidPath = 0

case(formStatus~>curField
("dwgNum" dwgNumber = formStatus~>curValue)
("done"
hsPort = infile("C:/_Temp/SKILL/Test_HeatSpreader_Data.csv")
numFound = "F"
when(hsPort
while(gets(txtLine hsPort)
infoList = parseString(txtLine ",")
listDwgNum = nth(0 infoList)
printf( "Drawing Number: %s\n" listDwgNum )
if(listDwgNum == dwgNumber then
numFound = "T"
;Flat Top Lid - 1500chamfer/500rad corner : 1000 rad cavity
;Single Piece Lid - 500rad corners : 1000 rad cavity
;2 Piece Stiffener/Stiffener Only - 1500chamfer : 1000 rad cavity
lidX = atof(nth(1 infoList))
lidY = atof(nth(2 infoList))
cavityX = atof(nth(3 infoList))
cavityY = atof(nth(4 infoList))
lidType = nth(5 infoList)
lidRadius = 500.0
lidCham = 1500.0
cavRadius = 1000.0

lidX1 = (lidX / 2.0) * -1
lidX2 = (((lidX / 2.0) - lidRadius) * -1)
lidX3 = (lidX / 2.0) - lidRadius
lidX4 = lidX / 2.0
lidY1 = (lidY / 2.0) * -1
lidY2 = (((lidY / 2.0) - lidRadius) * -1)
lidY3 = (lidY / 2.0) - lidRadius
lidY4 = lidY / 2.0
chamX = lidX1 + lidCham
chamY = lidY4 - lidCham
cavX1 = (cavityX / 2.0) * -1
cavX2 = (((cavityX / 2.0) - cavRadius) * -1)
cavX3 = (cavityX / 2.0) - cavRadius
cavX4 = cavityX / 2.0
cavY1 = (cavityY / 2.0) * -1
cavY2 = (((cavityY / 2.0) - cavRadius) * -1)
cavY3 = (cavityY / 2.0) - cavRadius
cavY4 = cavityY / 2.0
; Create the lid outline
if(lidType == "FTL" then
hsPath = axlPathStart((list lidX2:lidY1) 0)
hsPath = axlPathLine(hsPath 0.0 lidX3:lidY1)
hsPath = axlPathArcCenter(hsPath 0.0 lidX4:lidY2 nil lidX3:lidY2)
hsPath = axlPathLine(hsPath 0.0 lidX4:lidY3)
hsPath = axlPathArcCenter(hsPath 0.0 lidX3:lidY4 nil lidX3:lidY3)
hsPath = axlPathLine(hsPath 0.0 chamX:lidY4)
hsPath = axlPathLine(hsPath 0.0 lidX1:chamY)
hsPath = axlPathLine(hsPath 0.0 lidX1:lidY2)
hsPath = axlPathArcCenter(hsPath 0.0 lidX2:lidY1 nil lidX2:lidY2)
)
if(lidType == "SPL" then
hsPath = axlPathStart((list lidX2:lidY1) 0)
hsPath = axlPathLine(hsPath 0.0 lidX3:lidY1)
hsPath = axlPathArcCenter(hsPath 0.0 lidX4:lidY2 nil lidX3:lidY2)
hsPath = axlPathLine(hsPath 0.0 lidX4:lidY3)
hsPath = axlPathArcCenter(hsPath 0.0 lidX3:lidY4 nil lidX3:lidY3)
hsPath = axlPathLine(hsPath 0.0 lidX2:lidY4)
hsPath = axlPathArcCenter(hsPath 0.0 lidX1:lidY3 nil lidX2:lidY3)
hsPath = axlPathLine(hsPath 0.0 lidX1:lidY2)
hsPath = axlPathArcCenter(hsPath 0.0 lidX2:lidY1 nil lidX2:lidY2)
)
if(lidType == "2PS" || lidType == "SO" then
hsPath = axlPathStart((list lidX1:lidY1) 0)
hsPath = axlPathLine(hsPath 0.0 lidX4:lidY1)
hsPath = axlPathLine(hsPath 0.0 lidX4:lidY4)
hsPath = axlPathLine(hsPath 0.0 chamX:lidY4)
hsPath = axlPathLine(hsPath 0.0 lidX1:chamY)
hsPath = axlPathLine(hsPath 0.0 lidX1:lidY1)
)
hsShape = axlDBCreateOpenShape(hsPath t "ROUTE KEEPOUT/L01" nil)
voidPath = axlPathStart((list cavX2:cavY1) 0)
voidPath = axlPathLine(voidPath 0.0 cavX3:cavY1)
voidPath = axlPathArcCenter(voidPath 0.0 cavX4:cavY2 nil cavX3:cavY2)
voidPath = axlPathLine(voidPath 0.0 cavX4:cavY3)
voidPath = axlPathArcCenter(voidPath 0.0 cavX3:cavY4 nil cavX3:cavY3)
voidPath = axlPathLine(voidPath 0.0 cavX2:cavY4)
voidPath = axlPathArcCenter(voidPath 0.0 cavX2:cavY1 nil cavX2:cavY2)
axlDBCreateVoid(hsShape voidPath)
axlDBCreateCloseShape(hsShape)
) ;if dwgNumber
) ;while
if(numFound == "F" then axlUIConfirm( "Drawing number not found!" ))
)
close(hsPort)
axlFormClose(myform)
)
("cancel"
axlFormClose(myform)
)
) ;case
) ;let
)

I get this error:

W- *WARNING* (axlDBCreatePath): Not an r_path defstruct - 0

W- *WARNING* (axlDBCreateOpenShape): Object should be either an r_path or an o_polygon - 0

I created the paths like they showed, as the course said "The first argument is a path handle created with the axlPath () functions previously discussed."

If someone would help me out, I would really appreciate it.

Best regards,

Mark

  • Sign in to reply
  • Cancel
  • eDave
    0 eDave 23 days ago

    Hi Mark,

    Most of your code won't execute correctly because you have used "~" in place of "-" in formStatus~>curField and formStatus~>curValue

    BTW, you don't need to (read "shouldn't") zero all your variables. They are declared correctly as nil in your let statement.

    Regards,

    Dave

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • MarkGorecki
    0 MarkGorecki 23 days ago in reply to eDave

    Hi Dave,

    Thank you for checking out my code and for the advice.  I also found an error in my void path.  It's working now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • DavidJHutchins
    0 DavidJHutchins 22 days ago in reply to MarkGorecki

    I would recommend using sklint() to check your code, below is the results I got:

    C:\Temp>il_allegro
    > sklint(?file "test.ils")
    Loading skillLint.cxt
    INFO (LoadFile): Loading file C:\Cadence\SPB_22.1\tools\sklint/rules/allegro_sklint.il...
    INFO (LoadFile): Loading file C:\Cadence\SPB_22.1\tools\sklint/rules/hi2ipc.il...
    INFO (LoadFile): Loading file C:\Cadence\SPB_22.1\tools\sklint/rules/ignore.il...
    INFO (LoadFile): Loading file C:\Cadence\SPB_22.1\tools\sklint/rules/ilMig.il...
    INFO (REP008): Program SKILL Lint started on Aug 14 09:53:47 2025.
    INFO (PREFIXES): Using prefixes: "none"
    INFO (STRICT): Using strict checking of global variables.
    HINT (NTH1): test.ils, line 14 (CreateHSKO_Callback) : Can replace call to nth with call to car: nth(0 infoList)
    HINT (NTH1): test.ils, line 21 (CreateHSKO_Callback) : Can replace call to nth with call to cadr: nth(1 infoList)
    HINT (NTH1): test.ils, line 22 (CreateHSKO_Callback) : Can replace call to nth with call to caddr: nth(2 infoList)
    UNUSED VAR (Unused): test.ils, line 2 (CreateHSKO_Callback) : variable cavX1 does not appear to be referenced. (assigned only)
    INFO (VAR5): Unrecognized global variables:
    WARN GLOB (VAR8): dwgNumber
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, line 16
    INFO (VAR): set in Scheme:   in function CreateHSKO_Callback from file test.ils, line 7
    WARN GLOB (VAR8): hsPort
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, lines (93 12 11)
    INFO (VAR): set in Scheme:   in function CreateHSKO_Callback from file test.ils, line 9
    WARN GLOB (VAR8): hsShape
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, lines (88 87)
    INFO (VAR): set in Scheme:   in function CreateHSKO_Callback from file test.ils, line 79
    WARN GLOB (VAR8): infoList
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, lines (25 24 23 22 21 14)
    INFO (VAR): set in Scheme:   in function CreateHSKO_Callback from file test.ils, line 13
    WARN GLOB (VAR8): listDwgNum
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, lines (16 15)
    INFO (VAR): set in Scheme:   in function CreateHSKO_Callback from file test.ils, line 14
    WARN GLOB (VAR8): myform
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, lines (97 94)
    WARN GLOB (VAR8): numFound
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, line 91
    INFO (VAR): set in Scheme:   in function CreateHSKO_Callback from file test.ils, lines (17 10)
    WARN GLOB (VAR8): txtLine
    INFO (VAR): used in Scheme:  in function CreateHSKO_Callback from file test.ils, lines (13 12)
    INFO (IQ): IQ score is 0 (best is 100).
    INFO (IQ1): IQ score is based on 0 error messages, 9 general warning messages, and 1 top level forms.
    INFO (REP110): Total enhancement     : 0.
    INFO (REP110): Total external global : 0.
    INFO (REP110): Total package global  : 0.
    INFO (REP110): Total warning global  : 8.
    INFO (REP110): Total error global    : 0.
    INFO (REP110): Total unused vars     : 1.
    INFO (REP110): Total next release    : 0.
    INFO (REP110): Total alert           : 0.
    INFO (REP110): Total hint            : 3.
    INFO (REP110): Total suggestion      : 0.
    INFO (REP110): Total internal alert  : 0.
    INFO (REP110): Total information     : 31.
    INFO (REP110): Total warning         : 0.
    INFO (REP110): Total error           : 0.
    INFO (REP110): Total internal error  : 0.
    INFO (REP110): Total fatal error     : 0.
    INFO (REP009): Program SKILL Lint finished on Aug 14 09:53:48 2025 with status PASS.
    t
    >

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • MarkGorecki
    0 MarkGorecki 18 days ago in reply to DavidJHutchins

    Hi David, thank you for that info.  I'll look into sklint.

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

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

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