Jump to content

Recommended Posts

Posted

Can someone help me with a lisp file to project arc and circle objects to the view and replace them with ellipses?

Posted

Thank you very much Lee Mac,

you are as always a great help:lol:.

Posted

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

Posted

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

Posted

David Bethel, thanks a lot.

Lee Mac, thank you again.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...