De- bulge for Polyline- editing

 Hi,

Is there a 'de- bulge' command for Polyline- segments?
As much as I love using the QUAD but this command is missing for me. Removing a segment simply does not do the trick, but something else.

regards,

Clemens

Comments

  • Look at the 'adjust Bulge' option of the PEDITEXT command (you just have to hit enter after selecting the bulge) - it can also be found in the QUAD...
  •  Hi.

    Thanks for your response Knut.
    Unfortunately adjusting the bulge is something different than removing the bulge. That is what I really want to do.
    Simply create a line segment rather than an arc.

    I Should have been more specific about this.
  • Here is some Lisp code that should do the trick.
    Note: Tested on BricsCAD for Windows. Let me know if it works on the Mac version.
    [code](defun c:Debulge ( / doc enme elst)
      (if
        (and
          (setq enme (car (entsel)))
          (vl-position '(0 . "LWPOLYLINE") (setq elst (entget enme)))
        )
        (progn
          (setq doc (vla-get-activedocument (vlax-get-acad-object)))
          (if (= (logand (getvar 'undoctl) 8) 8)
            (vla-endundomark doc)
          )
          (vla-startundomark doc)
          (entmod
            (mapcar
              '(lambda (sub)
                (if (= 42 (car sub))
                  '(42 . 0.0)
                  sub
                )
              )
              elst
            )
          )
          (vla-endundomark doc)
        )
      )
      (princ)
    )[/code]
  • ... Here is code for a 'per segment' action:
    [code](defun c:DebulgeSegment ( / doc lst obj)
      (if
        (and
          (setq lst (entsel))
          (setq obj (vlax-ename->vla-object (car lst)))
          (vl-position (vla-get-objectname obj) '("AcDb2dPolyline" "AcDbPolyline"))

        )
        (progn
          (setq doc (vla-get-activedocument (vlax-get-acad-object)))
          (if (= (logand (getvar 'undoctl) 8) 8)
            (vla-endundomark doc)
          )
          (vla-startundomark doc)
          (vla-setbulge
            obj
            (fix
              (vlax-curve-getparamatpoint
                obj
                (vlax-curve-getclosestpointto
                  obj
                  (trans (osnap (cadr lst) "_nea") 1 0)
                )
              )
            )
            0.0
          )
          (vla-endundomark doc)
        )
      )
      (princ)
    )[/code]
  •  Hi Roy,

    Your LISP works on the MAC. Thanks.
    Exactly does what I want.
    Only thing is that I have to reload all LSP's every time I start BricsCad. Is there a way to Auto Load LISP's?

    I really would like Bricsys to include de de- bulge function into QUAD.
  • Some information on loading Lisp files is available on my website:
    http://www.b-k-g.nl/loading-lisp-programs.html
This discussion has been closed.