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)
)
)
)
)
)
|