Author Topic: Arc with START, END, MIDDLE points?  (Read 2653 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 737
Re: Arc with START, END, MIDDLE points?
« Reply #15 on: April 23, 2023, 08:09:54 AM »
pay attention :

I modified the code of my last two posts !

domenicomaria

  • Swamp Rat
  • Posts: 737
Re: Arc with START, END, CENTER points?
« Reply #16 on: April 23, 2023, 12:17:54 PM »
Lisp has no other function that supports previewing except for grread, unless you load the real-time capture function of ENTITYJIG written in C # or C++
BricsCAD has GRARC

(GRARC  ptCenter  radius  startAng  endAng  color  [minsegments  [highlight]])

this function draws a "temporary graphics" arc or circle, with specified radius and color; optionally in highlighted mode.

But i don't believe that it is enough !

ribarm

  • Gator
  • Posts: 3313
  • Marko Ribar, architect
Re: Arc with START, END, MIDDLE points?
« Reply #17 on: April 23, 2023, 02:11:44 PM »
Here is another that I think satisfy your request... It only previews CIRCLE instead of ARC...

Code - Auto/Visual Lisp: [Select]
  1. (defun c:3pcir-arc ( / st en li p1 p2 )
  2.  
  3.  
  4.   (initget 1)
  5.   (setq st (getpoint "\nPick or specify start point : "))
  6.   (initget 1)
  7.   (setq en (getpoint st "\nPick or specify end point : "))
  8.   (setq li (entmakex (list (cons 0 "LINE") (cons 10 (trans st 1 0)) (cons 11 (trans en 1 0)))))
  9.   (vl-cmdf "_.CIRCLE" "_3P" "_non" st "_non" en "\\")
  10.   (vl-cmdf "_.TRIM" li "" "_non" p1 "")
  11.   (initget "Yes No")
  12.   (if (= "No" (cond ( (getkword "\nIs ARC on good side [Yes / No] <Yes> : ") ) ( "Yes" )))
  13.     (progn
  14.       (vl-cmdf "_.UNDO" 1)
  15.       (vl-cmdf "_.TRIM" li "" "_non" p2 "")
  16.     )
  17.   )
  18.   (entdel li)
  19.   (princ)
  20. )
  21.  

HTH.
M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

glfiedler

  • Mosquito
  • Posts: 7
Re: Arc with START, END, MIDDLE points?
« Reply #18 on: April 28, 2023, 01:35:55 PM »
ribarm,
Thank you for sharing this lisp routine. It is perfect for the way I prefer to draw arc.

V@no

  • Newt
  • Posts: 25
  • AutoCAD 2023
Re: Arc with START, END, MIDDLE points?
« Reply #19 on: April 28, 2023, 10:32:08 PM »
Using 3-point-circle as preview:
Code - Auto/Visual Lisp: [Select]
  1. (DEFUN c:3parc (/ p1 p2 p3)
  2.     (SETVAR "cmdecho" 0)
  3.     (SETQ p1 (GETPOINT "Specify start point:"))
  4.     (SETQ p2 (GETPOINT p1 "\nSpecify end point:"))
  5.     (PRINC "\nSpecify middle point:")
  6.     (COMMAND "_.CIRCLE" "_3p" "_non" p1 "_non" p2 "\\")
  7.     (SETQ p3 (GETVAR 'lastpoint))
  8.     (COMMAND "_.UNDO" "1") ;remove circle
  9.     (COMMAND "_.ARC" "_non" p1 "_non" p3 "_non" p2) ;draw arc
  10.     (SETVAR "cmdecho" 1)
  11.     (PRINC)
  12. )