Author Topic: Break at point - Macro to Lisp  (Read 4464 times)

0 Members and 1 Guest are viewing this topic.

OTF

  • Guest
Break at point - Macro to Lisp
« on: November 19, 2014, 03:42:48 PM »
Hi,

I would appreciate your help on the following question. I am constantly using the break-at-point command in Autocad. I replaced the standard command with the following macro:

Code: [Select]
*^C^C_break \_f \@
How could I convert the macro to a lisp, so I can assign a keyboard shortcut to it?

Thank you very much.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Break at point - Macro to Lisp
« Reply #1 on: November 19, 2014, 03:55:40 PM »
Maybe this?

Code - Auto/Visual Lisp: [Select]
  1. (defun C:BreakAtPoint()
  2.     (command "._break" "f" "@")
  3. )
  4.  
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

OTF

  • Guest
Re: Break at point - Macro to Lisp
« Reply #2 on: November 19, 2014, 04:03:31 PM »
That was quick! Thank you.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Break at point - Macro to Lisp
« Reply #3 on: November 19, 2014, 04:11:39 PM »
Here's what I use...

Code: [Select]
(defun c:BA (/ e p)
  ;; Break Object @ Point
  ;; Alan J. Thompson, 03.26.09 / 08.23.10
  (setvar 'errno 0)
  (if (while (and (not e) (/= 52 (getvar 'errno))) (setq e (entsel "\nSelect object to break: ")))
    (progn (setq p (cond ((getpoint "\nSpecify point to break @ <Selection Point>: "))
                         ((osnap (cadr e) "_near"))
                   )
           )
           (vl-cmdf "_.break" e "_F" "_non" p "_non" p)
    )
  )
  (princ)
)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Re: Break at point - Macro to Lisp
« Reply #4 on: November 20, 2014, 07:03:15 AM »
I use a different approach. 
Shortcut Menus Arc Object Menu, Line Object Menu & LWPline Object Menu with this macro in each:
Code: [Select]
^C^C^P(setq ss (ssget))(command "_break" ss);\@;^C^C^P(progn(setq ss nil)(princ)) With one of these objects selected right-click and select Break @ to pick a point to break it.  Contextual is my preference for modifying objects.  Quick access without having to remember where to find an icon or what a keyboard shortcut is.
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Break at point - Macro to Lisp
« Reply #5 on: November 20, 2014, 09:23:46 AM »
I use a simple version:
Code - Auto/Visual Lisp: [Select]
  1. (defun C:BRAT(/ useros)
  2.   (setq useros (getvar "OSMODE"))
  3.   (command "OSNAP" "int")
  4.   (command "_.BREAK" pause "F" pause "@")
  5.   (setvar "OSMODE" useros)
  6. )
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.

Pad

  • Bull Frog
  • Posts: 342
Re: Break at point - Macro to Lisp
« Reply #6 on: November 20, 2014, 10:03:49 AM »
single pick version.
Room for improvement.

Code - Auto/Visual Lisp: [Select]
  1. ;; Single bick break at - Metrix PB
  2.  
  3. (defun C:Bsp ( / Ent Pt Tmp osm)
  4. (setq Tmp (getvar "cmdecho"))
  5. (setvar "Cmdecho" 0)
  6. (setq osm (getvar "osmode")) ;store osnap settings
  7. (setvar "osmode" 683)
  8.  
  9. (setq Pt (getpoint "\nspecify point break point: "))
  10. (setq Ent Pt)
  11. (command ".break" Ent "F" "none" Pt "none" Pt)
  12.  
  13. (setvar "Cmdecho" Tmp)
  14. (setvar "osmode" osm) ;RESTORE OSNAP
  15. )