Author Topic: Need help with macro for 3 point arc  (Read 5734 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
Need help with macro for 3 point arc
« 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

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Need help with macro for 3 point arc
« Reply #1 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)
)
TheSwamp.org  (serving the CAD community since 2003)

TJAM51

  • Guest
Need help with macro for 3 point arc
« Reply #2 on: February 03, 2005, 03:59:57 PM »
Neat routine but I was hoping not to type in but simply pick the locations.



Thanks

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Need help with macro for 3 point arc
« Reply #3 on: February 03, 2005, 04:01:11 PM »
type in what?
TheSwamp.org  (serving the CAD community since 2003)

ronjonp

  • Needs a day job
  • Posts: 7529
Need help with macro for 3 point arc
« Reply #4 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)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

TJAM51

  • Guest
Need help with macro for 3 point arc
« Reply #5 on: February 03, 2005, 04:05:18 PM »
I had to type in "NEAR" when it prompted me for point 1.


Thanks

TJAM51

  • Guest
Need help with macro for 3 point arc
« Reply #6 on: February 03, 2005, 04:06:49 PM »
:oops: I see now I realize now it did work.......thanks much....

VerticalMojo

  • Guest
Need help with macro for 3 point arc
« Reply #7 on: February 03, 2005, 04:32:49 PM »
Without LISP

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

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Need help with macro for 3 point arc
« Reply #8 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)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Need help with macro for 3 point arc
« Reply #9 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;\
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

t-bear

  • Guest
Need help with macro for 3 point arc
« Reply #10 on: February 03, 2005, 06:35:23 PM »
Man, you guys are havin' too much fun!  This stuff is cool!

TJAM51

  • Guest
Need help with macro for 3 point arc
« Reply #11 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);

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Need help with macro for 3 point arc
« Reply #12 on: February 04, 2005, 09:41:44 AM »
Are you trying to do this? [macro]

Code: [Select]
^C^C_arc \e;\d;
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

TJAM51

  • Guest
Need help with macro for 3 point arc
« Reply #13 on: February 04, 2005, 10:00:02 AM »
How could this be put to lisp?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Need help with macro for 3 point arc
« Reply #14 on: February 04, 2005, 10:15:53 AM »
Code: [Select]
(command "._arc" pause "_e" pause "_d" pause)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.