TheSwamp

CAD Forums => CAD General => Topic started by: juuva on February 19, 2015, 01:53:42 AM

Title: shifting position of all elements in drawing
Post by: juuva on February 19, 2015, 01:53:42 AM
Hello,
I have a drawing consisting mostly of polylines and blocks. I want to shift position of all objects and elements of objects (polyline vertices) so their new position will be rounded to given number of decimal placec. Example: there is line with starting point 10.2525, 23.9367.  New position will be 10.25, 23.94 for 2 decimal places.
I did something like this few months ago but I cannot remember how I did it. All I remember is that there was some workaround with saving the drawing as dxf after changing some cad variable.
Thank you for any advice.
Title: Re: shifting position of all elements in drawing
Post by: Rob... on February 19, 2015, 07:20:30 AM
You could change your units so that they round off to two decimal places. Some people do that here to cover up their inaccuracies.

Actually, what you are asking for could be a good tool to fine tune .dwgs that have been converted from an image format.
Title: Re: shifting position of all elements in drawing
Post by: juuva on February 19, 2015, 12:36:08 PM
Thank you for reply. I know about units, but I do not need only change of displayed coordinates of each element. I need to "physicaly" reposition all elements exactly to nearest position with let's say 2 decimal digits.
Routine I mentioned before was working like a charm but I cannot remember exact steps. I should start to make notes as I am getting older.
Title: Re: shifting position of all elements in drawing
Post by: mjfarrell on February 19, 2015, 12:47:15 PM
one might DXF the file open and edit

AcDbLine
 10
0.253
 20
0.253
 30
0.0
 11
10.808
 21
12.808
 31
0.0
  0

chopping everything to desired decimal precision, save and close.....
then DXFIN to a new file....not sure what the actual end result would be as far as accuracy....but it should work
Title: Re: shifting position of all elements in drawing
Post by: Lee Mac on February 19, 2015, 01:11:37 PM
You could try my program from here: http://autode.sk/15yfod1
Title: Re: shifting position of all elements in drawing
Post by: ronjonp on February 19, 2015, 01:57:36 PM
That's pretty slick Lee  8)
Title: Re: shifting position of all elements in drawing
Post by: Lee Mac on February 19, 2015, 04:46:33 PM
That's pretty slick Lee  8)

Cheers Ron!  :-)
Title: Re: shifting position of all elements in drawing
Post by: juuva on February 22, 2015, 04:38:48 PM
Thank you for all tips. Solution of the problem was simple.
FILEDIA set to 0. Then DXFOUT, in output precision dialog set desired precision of dxf file (0-16). When you open exported file you can see all geometry rounded to desired decimals.
Simple like that.
Title: Re: shifting position of all elements in drawing
Post by: cadtag on February 23, 2015, 08:02:42 AM
and now every line pline segment that was not at an angle of 0 has changed length.  Maybe not  bad thing for what you need, but something to be aware of