Need lisp to move all to 0,0,0, then back to original coords later
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use photometric software that glitches out if you work too far from 0. All the cad files I use are in a coordinate system far from zero, so I have to move everything to get the photometric program to work. I have created a lisp routine that moves everything from a specific point towards zero, then a reversal program that moves everything back. This works for most of my projects which are within a limited geographic area, but if I'm working on a project elsewhere, it doesn't work. Many many of my projects get xrefed together, and I work with consultants that use a specific coordinate system, so moving things permanently to zero is not an option. I want a lisp routine where I can snap to some object in the drawing, and it moves everything in the drawing so that object point I snapped to is now at zero. Later on I could reverse the process with a "reverse" command that would refer back to that point and put it back where it came from. I was thinking maybe it could place a text entity at the snap point with the coordinates in it, then when you issue the reverse command, it uses the insert point of the text, and the text values of the object to move it back where it belongs. That is my "I don't know how to write lisps" theory, there is probably a much better way. Any ideas, or anything already out there?
Here's the lisp I currently use if anyone is interested.
;--------* Move town objects toward zero for visual
;
(defun c:mfv (/ fvm)
(prompt "\nSelect objects to move closer to zero")
(setq fvm (ssget))
(command "move" fvm "" "0,0,0" "@-640000,-1623000")
(princ)
)
(princ)
;
;--------* Move town objects back to original coords
;
(defun c:btv (/ tvc)
(prompt "\nselect objects to move away from zero")
(setq tvc (ssget))
(command "move" tvc "" "0,0,0" "@640000,1623000")
(princ)
)
(princ)