View Full Version : Macro for moving x,y coordinates to new z coordinate
2Dcad
21st Aug 2007, 10:36 pm
Hello:
I need to Macro hundreds of x, y coordinates that will be the same to a new y coordinate that are mostly different.
I am using AutoCad 2007 LT.
Thanks
Raggi_Thor
29th Aug 2007, 01:43 pm
Do you mean to a new z coordinate?
Can you explain a little further.
Are you moving a lot of objects with different z value to one new z value?
2Dcad
29th Aug 2007, 07:09 pm
Yes:
I have several different elevations that will become one elevation which still have the same x/y cooridnates but the new z coordinate, or elevation.
Example: I have a cross-section of a four mile canal that will begin at a water elevation that was chosen for volacity characteristcs in which I need to start, then I will figure the sq. ft. area. At the present there are over 400 points to start from. I am trying to let the program do it faster.
Raggi_Thor
29th Aug 2007, 08:02 pm
In Acad 2008 and in Bricscad (and probably other Intellicad based programs) you have a command called FLATTEN. Both programs use the current UCS and move all coordinates to the x-y plane. Bricscad also asks for a new elevation! In AutoCAD you have to make a new UCS and then Flatten, or Flatten first and then move all objects to the desired z value.
I dont know if this works in LT and in 2007.
Alan Cullen
29th Aug 2007, 11:47 pm
It can be done quite easily with a lisp routine. Yell if you want me to knock one up for you, and tell me if the points are actually nodes, or blocks, or what. And tell me what other entities are on the drawing that you want to change the Z value of.
fuccaro
30th Aug 2007, 05:54 am
It can be done quite easily with a lisp routine. Alan
2DCad uses AutoCAD LT. Unless he install an extender he will be unable to use lisp:(
Alan Cullen
30th Aug 2007, 06:15 am
Aaaahhh, my bad. I missed that. Oh well, back to the drawing board. :(
lpseifert
30th Aug 2007, 12:19 pm
Select the points you want to change the z value (Qselect or Filter may help); in Properties edit the Z Position... or
If you want to move the points a relative distance use the Move command:
Command: MOVE
Select objects: Specify opposite corner: 6 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0,0
Specify second point or <use first point as displacement>: @0,0,400
This example moved the selection set 400 units in the Z direction.
Raggi_Thor
30th Aug 2007, 02:07 pm
Yes, and if you first use FLATTEN to move all objects from different z values down to the ground plane, then it should be OK.
But I assume Flatten is only in acad full version (and Bricscad)?
Alan Cullen
30th Aug 2007, 02:54 pm
Raggi_Thor,
Looks like you also got caught in my lack of observation.....no FLATTEN in LT. Oh well, back to the drawing board for both of us. :D
lpseifert
30th Aug 2007, 03:12 pm
Here's a trick to change selected objects to a Z value of 0, no matter what the original Z value is. If you select "All" it will "flatten" the entire drawing (works in LT).
Command: MOVE
Select objects: Specify opposite corner: 4 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0,0
Specify second point or <use first point as displacement>: 0,0,1E99
Command: M
MOVE
Select objects: P
4 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0,0
Specify second point or <use first point as displacement>: 0,0,-1E99
Raggi_Thor
31st Aug 2007, 08:02 am
Yes, but you may ave noticed that I am a fan of LT Extender :)
riga
31st Aug 2007, 11:17 am
Here's a trick to change selected objects to a Z value of 0, no matter what the original Z value is. If you select "All" it will "flatten" the entire drawing (works in LT).
Command: MOVE
Select objects: Specify opposite corner: 4 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0,0
Specify second point or <use first point as displacement>: 0,0,1E99
Command: M
MOVE
Select objects: P
4 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0,0
Specify second point or <use first point as displacement>: 0,0,-1E99
Great tricks, but with this file doesn't work. No Idea why.
With flatten I get the result but with your trick no way
Do you have any idea about the reasons?
SEANT
31st Aug 2007, 11:44 am
I think the reason is that those arcs are not only at different elevations but also misaligned from the WCS. If the units of the drawing are change to show five decimal places, the non standard Normals will show in the Properties Window.
Another confirmation: FLATTEN will produce Ellipses
Raggi_Thor
31st Aug 2007, 11:53 am
Another trick is to plot the file to a dxb (binary dxf).
Then you have a flat drawing and can move from there.
riga
31st Aug 2007, 02:03 pm
Another trick is to plot the file to a dxb (binary dxf).
Then you have a flat drawing and can move from there.
Right, or export a wmf file (wmfout) and then import the file in a new drawing. Same result
Seant, that is probably the reason. Some drawings has problem even with the command flatten
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.