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

Stats

  • Replies 3
  • Subscribers 17
  • Views 10229
  • Members are here 0
More Content

Cut Segment

ENEGUE
ENEGUE over 6 years ago

Hi Guys,

I am trying to develop a script to cut the segment 2mm apart, center of the line selected by user.

but i not sure how to create script that can cut multiple segment without re-run the script.

Here is my content, hope to get some input from you.=)

axlCmdRegister( "millin2g" `cutsegment ?cmdType "general")


(defun cutsegment ()
line_ya = 0
line_yb = 0
line_xa = 0
line_xb = 0
loop = t
gap = 2



while( loop

axlClearSelSet()
axlSetFindFilter( ?enabled (list "noall" "linesegs") ?onButtons (list "alltypes"))
axlSelect()
line = car(axlGetSelSet())
line_type = line->lineType

if(line_type == nil then

axlUIWPrint(nil "Please select line" )
axlClearSelSet()
axlShell("done")
loop = t

else
line_center = axlMidPointLine(list(car(line->startEnd) car(cdr(line->startEnd))))
case( strcat(line_type)
("horizontal" ;y is same from point xa to xb
line_xa = car(axlMidPointLine(line->startEnd))- gap
line_xb = car(axlMidPointLine(line->startEnd))+ gap
line_ya = car(cdr(line_center))
line_yb = line_ya

axlShell("done")
axlClearSelSet()
_cut(line_xa line_ya line_xb line_yb)
loop = nil
)
("vertical" ;x is same from point ya to yb
line_xa = car(line_center)
line_xb = line_xa
line_ya = car(cdr(axlMidPointLine(line->startEnd)))- gap
line_yb = car(cdr(axlMidPointLine(line->startEnd)))+ gap

axlShell("done")
axlClearSelSet()
_cut(line_xa line_ya line_xb line_yb)
loop = nil
)
)
)
)
)

Eugene

  • Cancel
  • Sign in to reply
Parents
  • ENEGUE
    ENEGUE over 6 years ago

    This is my cut function

    (defun _cut (xa ya xb yb)

    ;perform cut
    axlShell("delete;prepopup;pop cut")
    axlShell(sprintf(nil "pick %f %f" xa ya ))
    axlShell(sprintf(nil "pick %f %f" xb yb ))
    axlShell("Done")
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • ENEGUE
    ENEGUE over 6 years ago

    This is my cut function

    (defun _cut (xa ya xb yb)

    ;perform cut
    axlShell("delete;prepopup;pop cut")
    axlShell(sprintf(nil "pick %f %f" xa ya ))
    axlShell(sprintf(nil "pick %f %f" xb yb ))
    axlShell("Done")
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • eDave
    eDave over 6 years ago in reply to ENEGUE

    5432.Eugene_cut.zip

    Using a mixture of shell and Skill commands isn't recommended. See attached.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ENEGUE
    ENEGUE over 6 years ago in reply to eDave

    Wow, you come out with the skill command..Thanks! i definitely take sometimes to look at it and understand.

    Eugene 

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