| ||
名字:PutOnGrid.il 语言:SKILL 功能:消除版图中的off grid 内容: procedure( OnGrid( Point ) if( listp( Point ) then mapcar( lambda( (x) OnGrid(x) ) Point) else round((Point/Grid))*Grid ) ) procedure( PutOnGrid( Grid ) let(( SelectObj ) SelectObj = geGetSelSet() foreach( Object SelectObj cond( (Object~>objType == "path" Polygon = leConvertShapeToPolygon(Object) Polygon~>points = OnGrid(Polygon~>points) ) (Object~>objType == "polygon" Object~>points = OnGrid(Object~>points) ) (Object~>objType == "rect" Object~>bBox = OnGrid(Object~>bBox) ) (Object~>objType == "inst" || Object~>objType == "mosaic" Object~>xy = OnGrid(Object~>xy) ) ) ) ) ) 使用方法:在CIW中load这个il文件。使用时输OnGrid(0.005),如果你的最小格点是0.005的话。 |