The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 AutoCAD
 Lisp & Other Handy Files
 Find center of circle and move all objects

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Strobe 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
52.31 KB
3   L A T E S T    R E P L I E S    (Newest First)
Admin Posted - March 27 2019 : 5:56:43 PM
Awesome solution.

Thank you and your co-worker for sharing back.
Strobe 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)
(and
(setq ss (ssget "_x" '((0 . "circle")(8 . "O-GRID-DIMS"))))
(setq CenterPoint (cdr(assoc 10 (entget (ssname ss 0)))))
)
;(princ CenterPoint)
(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 "")
)
Strobe 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?

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.16 seconds. Snitz Forums 2000