This is what I am trying to do
User to select a shape drawn in a drawing layer, now I want the skill to draw cline segments on regular interval with given width horizontally in one etch layer and vertically on the adjacent layer
now I want to inserta a via on where the clines intersect on the adjacent layer
I am going to test out a procedure and let you guys know what is the result
Any ideas welcome
There is function axl_ol_ol2() which finds the intersection point of two lines and for adding a via we can use axlDBCreateVia().
By the way we can manually also place multiple vias using the Copy command on your preferred x and y spacing.I assume the purpose might be taking traces straight without bends.
I forgot to update, I figured it out and here is a sample code
Draw a shape (only rectangular) in an drawing layer then select it
I still don't know how to achieve this with an irregular shape(this is where i need some help)
axlClearSelSet() axlSetFindFilter(?enabled list("noall", "SHAPES"), ?onButtons list("noall", "SHAPES")) shape = car(axlGetSelSet(axlSelect()) ) layer1 = "CONDUCTOR/METAL2" layer2 = "CONDUCTOR/METAL1" _shbBox = shape->bBox _startX = car(xCoord(_shbBox)) _startY = cadr(xCoord(_shbBox)) _endX = car(yCoord(_shbBox)) _endY = cadr(yCoord(_shbBox))
i = _startY while(round(i)<=round(_endY) axlDBCreateLine((list _startX:i _endX:i), 20 layer1), i=i+100) j = _startX while(round(j)<=round(_endX) axlDBCreateLine((list j:_startY j:_endY), 20 layer2), j=j+100) axlClearSelSet() axlSetFindFilter(?enabled list("noall", "clines"), ?onButtons list("noall", "clines")) clines = axlGetSelSet(axlAddSelectBox(_shbBox)) axlClearSelSet() endType = 'SQUARE
l1_clines = setof(a clines a->layer == "CONDUCTOR/TOP") l2_clines = setof(a clines a->layer == "CONDUCTOR/BOTTOM) l1_lines = l1_clines~>segments~>startEnd l2_lines = l2_clines~>segments~>startEnd _xSecList= list() foreach(a l1_clines foreach(b l2_clines _xSecList = cons(axl_ol_ol2(car(a->segments)->startEnd car(b->segments)->startEnd) _xSecList)))
foreach(a _xSecList axlDBCreateVia("VIA1", car(a), nil, nil)