| ||
eetop上看到别人分享的脚本,做了修改。备份。
procedure(auto_slot( @optional (slot_space 2) (slot_size 1))
let(()
cv=geGetEditCellView()
obj=geGetSelSet()
list2=list()
list3=list()
slot_step=slot_size+slot_space
eoffset=0.5
if(obj != nil then
layer_name=car(obj~>layerName)
a=caar(obj~>bBox)
b=cadar(obj~>bBox)
x=car(b)-car(a)
y=cadr(b)-cadr(a)
countx=fix((x-slot_size-eoffset)/slot_step)+1
county=fix((y-slot_size-eoffset)/slot_step)+1
xoffset=(x+slot_space-slot_step*countx)/2
yoffset=(y+slot_space-slot_step*county)/2
for(n 0 county-1
y0=cadr(a)+yoffset+slot_step*n
if(oddp(n) != nil then
xa = (slot_space+slot_size)/2
else
xa = 0
)
for(i 0 countx-1
x0=car(a)+xoffset+xa+slot_step*i
text1=dbCreateRect(cv list("TTXT" "drawing") list(x0:y0 (x0+slot_size):(y0+slot_size)))
list1=list(text1)
list2=append(list1 list2)
i=1+1
)
list3=append(list2 list3)
n=n+1
)
shape1=dbLayerAnd(cv list("TTXT" "drawing") geGetSelSet() list3)
shape2=dbLayerAndNot(cv layer_name geGetSelSet() shape1)
geDeleteSelSet()
leMergeShapes(shape2)
foreach(shapea shape1
dbDeleteObject(shapea)
)
foreach(lista list3
dbDeleteObject(lista)
)
else
print("please select the metal to be sloteed")
)))