Migrating to BricsCAD, breakpoint.lsp not functioning as it is supposed to

Hi there. After 15 years I am trying out BricsCAD and thinking about making the switch full time. However there is one LSP routine that I am dependent on. It's called breakpoint.lsp and it's function is to break a line but with out creating a gap where the break occurs. However trying it out on BricsCAD results in a gap being created. I am an idiot when it comes to LSP routines and was wondering if anyone could help me figure out what if any variables I need to change to get it to run properly. Below is the routine.

(defun c:bad ( / object breakpoint)
(terpri)
;; Set a single object
(if (setq object (ssget ":S"))
(progn
;; Use the redraw function to highlight the selected object
(redraw (ssname object 0) 3)
;; Get the second break point
(if (setq breakpoint (getpoint "\nSpecify the break point "))
;; Use the Break command to break the selected object at the selected point
(command "._break" object breakpoint "@)
;; Inform the user that no point was selected
(progn
(prompt "\nNo point selected.")
(redraw (ssname object 0) 4)
)
)
)
;; Inform the user that no object was selected
(prompt "\nNo object selected")
)
(princ)
)

Comments

  • Anthony Apostolaros
    edited October 2018

    I don't know enough to say what's wrong with your function, but here's the one I use:
    ;;; --- VecWks-style Break command --- ;;; Select an object, then pick a single break point on that object. ;;; --------------------------------------------------------------- (defun c:B () (sssetfirst nil nil) (setq ent1 (entsel "Select Object: ")) (setq bp1 (getpoint "Break point: ")) (setq bp2 bp1) (command "Break" ent1 "F" bp1 bp2) )
    Don't worry about lisp. Bricscad's lisp is great, and highly compatible. The only problem I've ever had with using lisp functions designed for the less user-friendly DWG cad software is when they incorporate old obsolete features.

    To post code on this forum, pull down the cryptogram consisting of two parallel lines with a lump on one of them, and select "Code." Then immediately paste your code in.

  • Anthony Apostolaros
    edited October 2018

    Joe, your function works if I change this line:
    (command "._break" object breakpoint "@)
    to this:
    (command "._break" object "F" breakpoint breakpoint)

    Perhaps "@ was a typographical error? I don't think it's allowed in any lisp syntax. "@" would be allowed, and with the Break command it should mean "use the same point as where the entity was selected." Your function apparently wants it to mean "use the same point that I already passed to you." But it doesn't work that way, at least in Bricscad. I don't know whether it should work that way with a point that's being passed to the command.

    The thing I mainly wanted from a custom Break command was to avoid using the entity selection point as a break point. That's because I nearly always want to break at an intersection, where it's hard to predict which of the two intersecting entities would be selected. If you actually want the entity selection point to be the single break point, all you need is this:
    (defun c:bad () (command "break" pause "@") )

  • @Anthony Apostolaros said:
    Joe, your function works if I change this line:
    (command "._break" object breakpoint "@)
    to this:
    (command "._break" object "F" breakpoint breakpoint)

    Perhaps "@ was a typographical error? I don't think it's allowed in any lisp syntax. "@" would be allowed, and with the Break command it should mean "use the same point as where the entity was selected." Your function apparently wants it to mean "use the same point that I already passed to you." But it doesn't work that way, at least in Bricscad. I don't know whether it should work that way with a point that's being passed to the command.

    The thing I mainly wanted from a custom Break command was to avoid using the entity selection point as a break point. That's because I nearly always want to break at an intersection, where it's hard to predict which of the two intersecting entities would be selected. If you actually want the entity selection point to be the single break point, all you need is this:
    (defun c:bad () (command "break" pause "@") )

    Thank you so much. I most definitely do not want the entity selection point to be the break point.

  • Yep that one simple change in code made the difference. Thanks to the both of you

This discussion has been closed.