(
LengthSeg1 = 8.0
LengthSeg2 = 4.7
LengthSeg3 = 3.4
thresh = 0.1 -- (LengthSeg1 +- thresh)
progressstart "Selection splines by length in shape..."
sp = if classOf $ == SplineShape then $ else undefined
ns = numSplines sp
arSegs = #()
for i = 1 to ns do(
ls = getSegLengths sp i
lsc = ls.count
ls = ls[lsc]
if ls > (LengthSeg1-thresh) and ls < (LengthSeg1+thresh) do append arSegs i
if ls > (LengthSeg2-thresh) and ls < (LengthSeg2+thresh) do append arSegs i
if ls > (LengthSeg3-thresh) and ls < (LengthSeg3+thresh) do append arSegs i
progressupdate (((i as float)/(ns as float))*100.0)
)
setSplineSelection sp arSegs
progressend ()
)
Может очень пригодиться, если необходимо, к примеру, почистить чертежи из автокада от штриховки и т.п.