I wanted to make this into a LISP:
- 1. Draw a circle (ask user for Diameter or Radius).
- 2. Place in a layer called "Fulcrum", the layer already exists.
- 3. Make it as a block using something similar to the code (mostly by others) below. The block goes in the currently used layer, typically "0".
- 4. Place the block by clicking the cursor at any point the screen. Prefer to snap to something if possible.
Understand it's a lot of work for a simple thing, but I typically draw this way, starting a block with a circle as an anchor point, and then editing in place.
(defun c:MakeBlock (/ bkn eee i ndx nm ssst st)
(if (and (setq ssst (ssget)) (setq st (getpoint "\nPick Base Point: ")))
(progn (setq ndx 0)
(setq time (rtos (getvar "CDATE") 2 6)) ; Format YYYYMMDD.HHMMSS
(setq year (substr time 3 2)) ; Two digits instead of four
(setq month (substr time 5 2))
(setq day (substr time 7 2))
(setq hour (substr time 10 2)) ; Increment of 3 from day to account for "." character
(setq minutes (substr time 12 2))
(setq seconds (substr time 14 2))
(while (tblobjname "block" (setq nm (strcat "Block-" year month day hour minutes seconds))))
(entmake (list '(0 . "BLOCK")
'(100 . "AcDbEntity")
'(67 . 0)
'(8 . "0")
'(100 . "AcDbBlockReference")
(cons 2 nm)
(cons 10 st)
'(70 . 0)
)
)
(repeat (sslength ssst)
(entmake (cdr (entget (ssname ssst ndx))))
(entdel (ssname ssst ndx))
(setq ndx (+ 1 ndx))
)
(entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
(entmake (list (cons 0 "INSERT")
(cons 2 nm)
(cons 6 (getvar "CELTYPE"))
(cons 8 (getvar "CLAYER"))
(cons 66 0)
(cons 10 st)
(cons 41 1)
(cons 42 1)
(cons 43 1)
(cons 50 0)
(cons 71 0)
(cons 44 0)
(cons 45 0)
)
)
)
)
(princ)
)