Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My apologies. I made fun in another thread about exploding circles.
To compensate (partially), I submit the following:
(It actually turns a circle into a specified number of arcs)
;; ExplodeCircle.lsp written for fun by John F. Uhden (12-28-16) ;; (defun c:ExplodeCircle ( / *error* vars ans n e ent dxf8 dxf10 dxf40 dang eang bang) (vl-load-com) (defun *error* (err) (mapcar '(lambda (x)(setvar (car x)(cdr x))) vars) (vla-endundomark *doc*) (cond ((not err)) ((wcmatch (strcase err) "*CANCEL*,*QUIT*")) (1 (princ (strcat "\nERROR: " err))) ) (princ) ) (or *acad* (setq *acad* (vlax-get-acad-object))) (or *doc* (setq *doc* (vla-get-ActiveDocument *acad*))) (vla-endundomark *doc*) (vla-startundomark *doc*) (setq vars (mapcar '(lambda (x)(cons x (getvar x))) '("cmdecho" "osmode"))) (mapcar '(lambda (x)(setvar (car x) 0)) vars) (command "_.expert" (getvar "expert")) ;; dummy command (while (not n) (initget 7) (setq ans (getint "\nEnter number of arcs to create: ")) (if (= (type ans) 'INT)(setq n ans)) ) (while (setq e (car (entsel "\nSelect a circle to explode: "))) (and (setq ent (entget e)) (or (= (cdr (assoc 0 ent)) "CIRCLE") (prompt "\nEntity selected is not a circle.") ) (entdel e) (setq dxf8 (assoc 8 ent)) (setq dxf10 (assoc 10 ent)) (setq dxf40 (assoc 40 ent)) (setq dang (/ pi n 0.5)) (setq bang 0.0) (repeat n (setq eang (+ bang dang)) (entmakex (list '(0 . "ARC") dxf8 dxf10 dxf40 (cons 50 bang)(cons 51 eang))) (setq bang eang) ) ) ) (*error* nil) ) (defun c:XC ()(c:ExplodeCircle))
I really have no use for it, but maybe it could be modified to be of some value (sorta like divide and break).
And, no, it doesn't check for locked layers. Nor do you see anything happening.
Plus I should have used errmode so that a missed pick doesn't end it.
But that's all you should expect from an old fart.
John F. Uhden
Solved! Go to Solution.