• 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. axlSingleSelectPoint not accurately !

Stats

  • Replies 4
  • Subscribers 159
  • Views 13511
  • Members are here 0
More Content

axlSingleSelectPoint not accurately !

luanvn81
luanvn81 over 12 years ago

 Hi all!
   I'm writting a skill to check at start point & end point of a cline if pin exist or not, if pin exist and pin's netname ="dummy",
   then assign that cline to that pin. AND , if the coordinate is in the restrict area (box_xy) then do nothing. But I got the problem,
   when I put the code to get restrict area, the code still run but the function axlSingleSelectPoint not accurately, otherwise, it's ok.
   Who can show me where's wrong? and how can I fix it?.
   
..............


; =====Get box  xy, (default: leftdonwn- rightup)=====
box_xy = axlEnterBox(?prompts list("First rectangle point, please...", "Second rectangle point, please..."))
axlClearSelSet()
loc1_x = xCoord(car(box_xy))
loc1_y = yCoord(car(box_xy))
loc2_x = xCoord(cadr(box_xy))
loc2_y = yCoord(cadr(box_xy))

;=====process if user pick from any coner for making axlEnterBox()=====
if(loc1_x < loc2_x && loc1_y < loc2_y then
  box1x = loc1_x
  box1y = loc1_y
  box2x = loc2_x
  box2y = loc2_y
else
if(loc1_x < loc2_x && loc1_y > loc2_y then
  box1x = loc1_x
  box1y = loc2_y
  box2x = loc2_x
  box2y = loc1_y
else
if(loc1_x > loc2_x && loc1_y < loc2_y then
  box1x = loc2_x
  box1y = loc1_y
  box2x = loc1_x
  box2y = loc2_y
else
  box1x = loc2_x
  box1y = loc2_y
  box2x = loc1_x
  box2y = loc1_y
);enf if 1
);end if 2
);end if 3

;=====Prepare =====
axlSetFindFilter(?enabled '(noall pins) ?onButtons '(noall pins))
axlClearSelSet()
axlVisibleDesign(nil)
axlVisibleUpdate(t)
axlVisibleLayer("Pin/top" t)
axlUIWUpdate(nil)
axlClearSelSet()

;=====Main process=====
foreach(clines allWiresInDesign
netname = clines->net->name
if(stringp(netname) then
when(nindex(netname, "__")    
;=====get location xy at start cline & end cline=====
cline_seg = clines->segments            ;get all segment in a cline
first_seg = car(cline_seg)                ;get first segment
last_seg = car(last(cline_seg))            ;get last segment
first_seg_xy = car(first_seg->startEnd)
last_seg_xy = cadr(last_seg->startEnd)    

x1= xCoord(car(first_seg->startEnd))           
y1= yCoord(car(first_seg->startEnd))
x2= xCoord(lastelem(last_seg->startEnd))
y2= yCoord(lastelem(last_seg->startEnd))

;===CHECK LOCATION X1:Y1 IF PIN EXIST OR NOT=====
if(and(x1>box1x, x1<box2x, y1>box1y, y1<box2y) == nil then
pinselect = axlGetSelSet(axlSingleSelectPoint(x1:y1))
axlClearSelSet()
if( pinselect != nil then
pinselect = car(pinselect)
sym_name = pinselect->component->name
pin_net_name = pinselect->net->name
pin_number = pinselect->number
if(pin_net_name == "" then
  fprintf(writeOutFile, "%s %s\n", "FORM mini netlist ", netname)
  fprintf(writeOutFile, "%s %s.%s\n", "FORM mini pinname ", sym_name, pin_number)
  fprintf(writeOutFile, "next\n")
);endif
);end if pinselect==nil
);end if

;===CHECK LOCATION X2:Y2 IF PIN EXIST OR NOT=====
if(and(x2>box1x, x2<box2x, y2>box1y, y2<box2y) == nil then
pinselect = axlGetSelSet(axlSingleSelectPoint(x2:y2))
axlClearSelSet()
if( pinselect != nil then
pinselect = car(pinselect)
sym_name = pinselect->component->name
pin_net_name = pinselect->net->name
pin_number = pinselect->number
if(pin_net_name == "" then
  fprintf(writeOutFile, "%s %s\n", "FORM mini netlist ", netname)
  fprintf(writeOutFile, "%s %s.%s\n", "FORM mini pinname ", sym_name, pin_number)
  fprintf(writeOutFile, "next\n")
);end if - (1-24)
);end if pinselect==nil)
);end if

);end when
);end if stringp
);end foreach via allWiresInDesign

.........


Tks!
Luan.

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

    Hi Luan,

    You need to thoroughly check your logic.

    Try using "when" and "unless" instead of "if(a == b" and "if(a != b".

    Don't forget that axlSingleSelectPoint depends on the trap size so will give arbitrary results if you are not careful. 

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

    Hi Luan,

    You need to thoroughly check your logic.

    Try using "when" and "unless" instead of "if(a == b" and "if(a != b".

    Don't forget that axlSingleSelectPoint depends on the trap size so will give arbitrary results if you are not careful. 

    • 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