TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TJAM51 on February 03, 2005, 03:10:26 PM

Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 03, 2005, 03:10:26 PM
I need to draw a 3 point arc but I need to have the osmode set to nearest for the first point, the osmode set to zero for the second point and the osmode set back to nearest (512) for the third and last point......I know it possibly can be doen but how......


Thanks
Title: Need help with macro for 3 point arc
Post by: Mark on February 03, 2005, 03:57:14 PM
will something like this work?
Code: [Select]

(defun c:a3 (/ osm p1 p2 p3)

  (setq osm (getvar 'osmode))
  (setvar 'osmode 0)


  (if (setq p1 (osnap (getpoint "\nPoint 1: ") "_near"))
    (if (setq p2 (osnap (getpoint p1 "\nPoint 2: ") "_none"))
      (if (setq p3 (osnap (getpoint p2 "\nPoint 3: ") "_near"))
(vl-cmdf "_arc" p1 p2 p3)
      )
    )
  )

  (setvar 'osmode osm)

  (princ)
)
Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 03, 2005, 03:59:57 PM
Neat routine but I was hoping not to type in but simply pick the locations.



Thanks
Title: Need help with macro for 3 point arc
Post by: Mark on February 03, 2005, 04:01:11 PM
type in what?
Title: Need help with macro for 3 point arc
Post by: ronjonp on February 03, 2005, 04:05:08 PM
Here is another one:

Code: [Select]
(defun c:3arc (/ osm)
  (setq osm (getvar 'osmode))
  (setvar 'osmode 0)
  (command ".arc" "_near" pause "_none" pause "_near" pause)
  (setvar 'osmode osm)
  (princ)
)
Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 03, 2005, 04:05:18 PM
I had to type in "NEAR" when it prompted me for point 1.


Thanks
Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 03, 2005, 04:06:49 PM
:oops: I see now I realize now it did work.......thanks much....
Title: Need help with macro for 3 point arc
Post by: VerticalMojo on February 03, 2005, 04:32:49 PM
Without LISP

osmode;0;_arc near;\_c;\near;\
Title: Need help with macro for 3 point arc
Post by: CAB on February 03, 2005, 05:41:43 PM
Quote from: ronjonp
Here is another one:

Code: [Select]
(defun c:3arc (/ osm)
  (setq osm (getvar 'osmode))
  (setvar 'osmode 0)
  (command ".arc" "_near" pause "_none" pause "_near" pause)
  (setvar 'osmode osm)
  (princ)
)

When you use the osmode override you don't need to set osmode to 0
Code: [Select]
(defun c:3arc ()
  (command ".arc" "_near" pause "_none" pause "_near" pause)
  (princ)
)
Title: Need help with macro for 3 point arc
Post by: CAB on February 03, 2005, 05:48:02 PM
Quote from: VerticalMojo
Without LISP

osmode;0;_arc near;\_c;\near;\


That is a good one, here without _c
Code: [Select]
^C^C_arc _near;\_non;\_near;\
Title: Need help with macro for 3 point arc
Post by: t-bear on February 03, 2005, 06:35:23 PM
Man, you guys are havin' too much fun!  This stuff is cool!
Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 04, 2005, 08:57:45 AM
Here would be a different type of 3 point arc.....first point and second point and the drag in the desired direction....here is a macr of a similar situation...how could this be put to lisp?

Thanks


arc;node,quad;\$M=E;node,quad;\;$(getvar,lastpoint);
Title: Need help with macro for 3 point arc
Post by: CAB on February 04, 2005, 09:41:44 AM
Are you trying to do this? [macro]

Code: [Select]
^C^C_arc \e;\d;
Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 04, 2005, 10:00:02 AM
How could this be put to lisp?
Title: Need help with macro for 3 point arc
Post by: CAB on February 04, 2005, 10:15:53 AM
Code: [Select]
(command "._arc" pause "_e" pause "_d" pause)
Title: Need help with macro for 3 point arc
Post by: TJAM51 on February 04, 2005, 10:21:32 AM
THANKS SO VERY MUCH TO ALL THAT RESPONDED TO THIS REQUEST.