Reverse Direction of a Polyline

Hello, I m new here, so Hi to everyone.

I ve installed BricsCAD some days now and I can say I m really happy.

I was using Acad. I need to reverse the direction of a polyline with one command, just how Im used to do. I don't remember the command I was using because I customize a lot (it was just the "R" command… I think it was the REVERSE Acad)

Now in BricsCAD I have to PEDIT and then press R to reverse the polyline

Is there a way to do it in one step? One command solution?

Thanks a lot

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Hello.

    In Bricscad, the REVERSE command is not defined.

    The simpleset way of working seems to be to create a button tool using an expression like:
    ^C^C_.pedit;_r;;

    A more advanced solution would be to create a lisp function defining a custom command named REVERSE and have this function automatically loaded.

  • edited November 2024

    see attached lisp.

    PEDIT command have reverse function.

    using lisp save some clicks…

  • Thanks to all of you. It is very helpfull. Nice forum!

  • This is what I use to work out the start end point of a P/Line.

    (defun swapends (entl / )
    (setq pt (cadr entl))
    (setq obj (vlax-ename->vla-object (car entl)))
    (setq start (vlax-curve-getstartPoint obj))
    (setq end (vlax-curve-getendPoint obj))
    (setq d1 (distance pt start))
    (setq d2 (distance pt end))
    (if (> d1 d2)
    (progn
    (if (= (vlax-get obj 'objectname) "LWPOLYLINE")
    (command "pedit" (car entl) "reverse" "")
    (progn
    (vlax-put obj 'startpoint end)
    (vlax-put obj 'endpoint start)
    )
    )
    )
    )
    (princ)
    )

    (setq ent (entsel "\nPick object near end "))
    (swapends ent)

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.