axlCmdRegister("change_net_trace" `change_net_trace ) (defun change_net_trace () cmd_str_list = nil ori_vis = axlVisibleGet() axlVisibleDesign(nil) axlVisibleLayer("VIA CLASS" t) axlClearSelSet() axlSetFindFilter(?enabled '(noall VIAS NAMEFORM) ?onButtons '(noall ALL)) axlAddSelectAll() via_list = axlGetSelSet() axlVisibleSet(ori_vis) axlClearSelSet() axlSetFindFilter(?enabled '(noall CLINES SHAPES NAMEFORM) ?onButtons '(noall ALL)) mypopup = axlUIPopupDefine(nil (list (list "Done" 'axlFinishEnterFun) (list "Cancel" 'axlCancelEnterFun))) axlUIPopupSet( mypopup) axlSelect(?prompt "Please select an element...") select_list = axlGetSelSet() axlClearSelSet() foreach(item select_list sub = cadr(parseString(item->layer "/")) if(item->objType == "path" then cline = item st_clines = cline->segments~>startEnd st_seg = car(cline->segments)->startEnd tmp = length(setof(e st_clines member(car(st_seg) e) != nil)) if(tmp == 2 then st_seg = reverse(st_seg) ) last_seg = lastelem(cline->segments)->startEnd tmp = length(setof(e st_clines member(car(last_seg) e) != nil)) if(tmp == 2 then last_seg = reverse(last_seg) ) poly = car(axlPolyFromDB(car(cline->segments) ?endCapType 'ROUND)) via = car(setof(e via_list axlPadOnLayer(e strcat("ETCH/" sub)) == t && axlGeoPointInShape(e->xy poly nil) == t)) cmd_str_list = cons( sprintf(nil "pick %f %f; pick %f %f" xCoord(car(st_seg)) yCoord(car(st_seg)) xCoord(via->xy) yCoord(via->xy)) cmd_str_list) poly = car(axlPolyFromDB(lastelem(cline->segments) ?endCapType 'ROUND)) via = car(setof(e via_list axlPadOnLayer(e strcat("ETCH/" sub)) == t && axlGeoPointInShape(e->xy poly nil) == t)) cmd_str_list = cons( sprintf(nil "pick %f %f; pick %f %f" xCoord(car(last_seg)) yCoord(car(last_seg)) xCoord(via->xy) yCoord(via->xy)) cmd_str_list) else vias = nil if(item->shapeBoundary == nil then poly = car(axlPolyFromDB(item ?endCapType 'ROUND)) vias = setof(e via_list e->net->name != "" && axlPadOnLayer(e strcat("ETCH/" sub)) == t && axlGeoPointInShape(e->xy poly nil) == t ) else poly = car(axlPolyFromDB(item->shapeBoundary ?endCapType 'ROUND)) vias = setof(e via_list e->net->name != "" && axlPadOnLayer(e strcat("ETCH/" sub)) == t && axlGeoPointInShape(e->xy poly nil) == t ) poly = car(axlPolyFromDB(item ?endCapType 'ROUND)) if(poly->holes != nil then foreach(hole poly->holes vias = setof(e vias axlGeoPointInShape(e->xy car(axlPolyFromHole(hole)) nil) == nil ) ) ) ) if(vias != nil then via = car(vias) axlChangeNet(item via->net) ) ) ) if(cmd_str_list != nil then axlShell("setwindow pcb; prepopup 0.0 0.0; done") axlCmdRegister("_slide_seg" `_slide_seg ?cmdType "general") axlShellPost("_slide_seg") ) ) (defun _slide_seg () if(cmd_str_list != nil then axlShell("setwindow pcb; slide; setwindow form.find; FORM find all_off ; FORM find cline_segs YES ; FORM mini allow_errors YES;") foreach(cmd cmd_str_list axlShell(cmd) ) axlCmdUnregister("_slide_seg") axlShell("setwindow pcb; done;change_net_trace") ) )