AUTOCAD IS MY LIFE Posted March 15 Share Posted March 15 (edited) i have a lisp : this lisp will be move the character to center another object(rectang, circle,...), please help me upgrade this lisp :Just click on the space of the object don't need click the object (defun c:m2c () (defun mid (ent / p1 p2) (vla-getboundingbox (vlax-ename->vla-object ent) 'p1 'p2) (setq p1 (vlax-safearray->list p1) p2 (vlax-safearray->list p2) pt (mapcar '+ p1 p2) pt (mapcar '* pt '(0.5 0.5 0.5)) ) pt ) (setq src (car (entsel "\nobject to be moved: "))) (redraw src 3) (setq des (car (entsel "\npick center object: "))) (redraw src 4) (setq oldos (getvar "osmode")) (setvar "osmode" 0) (command ".move" src "" (mid src) (mid des)) (setvar "osmode" oldos) (princ) ) (vl-load-com) Edited March 15 by fuccaro Renamed, added CODE tags... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 16 Share Posted March 16 If you use bpoly it will make a new object inside a closed shape so can be multiple objects so long as your internal is closed. Once you have that new pline you can get centroid or some form of average point of the vertices. In the case of the circle it will make 2 arcs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.