Ahankhah Posted March 29, 2011 Posted March 29, 2011 Can someone help me with a lisp file to project arc and circle objects to the view and replace them with ellipses? Quote
Lee Mac Posted March 29, 2011 Posted March 29, 2011 Perhaps this will point you in the right direction: http://www.cadtutor.net/forum/showthread.php?55816-Ellipse-Routine-Request&p=378365&viewfull=1#post378365 Simple code, but may help Quote
Ahankhah Posted March 29, 2011 Author Posted March 29, 2011 Thank you very much Lee Mac, you are as always a great help:lol:. Quote
David Bethel Posted March 29, 2011 Posted March 29, 2011 Here is an old project.lsp from the Autodesk Training Department. It was written in the 80's before Autodesk put it's license from hell in the headers of any tidbit of code they included with the software. it's a good learning / teaching tool. -David PROJECT.LSP Quote
Lee Mac Posted March 29, 2011 Posted March 29, 2011 Perhaps this is suitable: (defun LM:ProjectArc ( e / el l r n ) (if (member (cdr (assoc 0 (setq el (entget e)))) '("ARC" "CIRCLE")) (entmakex (append (list (cons 0 "ELLIPSE") (cons 100 "AcDbEntity") (cons 100 "AcDbEllipse") ) (foreach x '(6 8 39 48 62 210) (if (assoc x el) (setq l (cons (assoc x el) l)) l) ) (list (cons 10 (trans (cdr (assoc 10 el)) e 0)) (cons 11 (polar '(0. 0. 0.) (angle '(0. 0. 0.) (trans (getvar 'UCSXDIR) 0 (setq n (trans '(0. 0. 1.) 1 0 t)) t) ) (setq r (cdr (assoc 40 el))) ) ) (cons 40 (abs (/ (* r (apply '+ (mapcar '* '(0. 0. 1.) n))) r))) (cons 41 (cond ( (cdr (assoc 50 el)) ) ( 0.0 ))) (cons 42 (cond ( (cdr (assoc 51 el)) ) ( (* 2. pi) ))) ) ) ) ) ) (defun c:test ( / e ) (if (setq e (car (entsel "\nSelect Arc or Circle: "))) (LM:ProjectArc e)) (princ) ) The code will project supplied Arcs/Circles drawn in WCS to the current UCS Quote
Ahankhah Posted March 30, 2011 Author Posted March 30, 2011 David Bethel, thanks a lot. Lee Mac, thank you again. Quote
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.