|T O P I C R E V I E W
||Posted - March 27 2019 : 1:21:24 PM
Hi guys. Long time user of Hurricane looking for help.
I get drawings (DWG files) exported from a 3D plant design software package called Aveva E3D. The DWG files are Mechanical GAs from E3D that we need to use as xref in AutoCAD. The coordinates between E3D and AutoCAD don’t align (they never have or will).
My task is to move all DWG objects to the correct coordinates in the exported DWG files so they can be used as xrefs by other disciplines. Revised files are exported nightly.
This is what I need to do:
• The DWGs contain a circle on a layer O-GRID-DIMS
• It’s the only circle or object on that layer
• Find the center of that circle (which is 0,0,0 in E3D)
• Move all objects from the center of that circle to coordinate 0,0,0
The end goal is to create a batch process requiring no user action that we can use on a daily basis to update these xrefs from the 3D plant design package. E3D DWG sample attached.
Any ideas or suggestions?
Download Attachment: GA_Test1.zip
|3 L A T E S T R E P L I E S (Newest First)
||Posted - March 27 2019 : 5:56:43 PM
Thank you and your co-worker for sharing back.
||Posted - March 27 2019 : 4:38:36 PM
A co-worker came up with the solution. Maybe it will help someone else. Here it is...
(defun c:amod (/ ss CenterPoint X Y StartPoint EndPoint)
(setq ss (ssget "_x" '((0 . "circle")(8 . "O-GRID-DIMS"))))
(setq CenterPoint (cdr(assoc 10 (entget (ssname ss 0)))))
(setq X(car CenterPoint))
(setq Y(cadr CenterPoint))
(setq StartPoint(strcat (rtos X) "," (rtos Y) ",0.0000"))
(setq EndPoint "0.0000,0.0000,0.0000")
(command ".move" "all" "" StartPoint EndPoint "")
||Posted - March 27 2019 : 1:40:08 PM
I've figured out how to use SSX to select the circle and SSX to pick all objects but can't figure out how to pick the center of the circle for the MOVE command line. Will this require a lisp file?