Reverse a line

Is there any way to reverse the 'direction' of a line? in order to alter which end extends when its Length is edited in Properties.

Comments

  • I do not know the answer ....

    but I am so happy to have Vectorworks using all 2D objects parametric
    for direct Size Editing in properties palette - and offering a small gizmo (*),
    that allows you to choose the center of scaling.
    (*) Even by adapting the gizmo to your current drawing view, orthogonally
    and isometrics.

    And of course there is a button to switch Lines, Polylines, Walls, .... directions.
  • I use this.
    (defun c:rv ( / e_list e_type memb selset temp) (and (setq selset (ssget "_:L" '((0 . "LINE,LWPOLYLINE,SPLINE,ARC,CIRCLE")))) (setq e_list (vle-selectionset->list selset)) (foreach memb e_list (setq e_type (vle-entget 0 memb)) (cond ;; Line ( (eq "LINE" e_type) (setq temp (vle-entget 10 memb)) (vle-entmod 10 memb (vle-entget 11 memb)) (vle-entmod 11 memb temp) ) ;; LWPolyline ( (eq "LWPOLYLINE" e_type) (command "_pedit" memb "_R" "") ) ;; Arc ( (eq "ARC" e_type) (command "_pedit" memb "_Y" "_R" "") ) ;; Circle ( (eq "CIRCLE" e_type) (command "_pedit" memb "_Y" "_R" "") ) ;; SPLINE ( (eq "SPLINE" e_type) (vla-reverse (vlax-ename->vla-object memb)) ) ) ) ) (princ) )
  • Does the attached do what you need?
  • Pedit reverses polylines. Pick your line Pedit , yes convert, revert . Then explode if you dont want it to stay pline
  • Rotate it 180° about its midpoint.
  • Thanks - all good - but Acad has a simple REVERSE command. Wonder why Brics doesn't.
  • This came up in another thread - best suggestion was to SCALE the line, picking its midpoint and entering -1 for the scale!

  • aridzv
    edited November 18

    @Tom Foster

    see attached lisp.

    it reverse both ploylines and lines.

  • ALANH
    edited 2:22AM

    I often use a pick near start end you compare the pt to the actual start and endpoint distance and swap for calculations which can be enough or if you have to reverse the pline or line as suggested. I normally have as a defun for multi picks. Line example have extra check if pline use pedit reverse.

    (setq ent (entsel "\nPIck crossing object near end Enter to exit "))
    (setq pt (cadr ent))
    (setq obj2 (vlax-ename->vla-object (car ent)))
    (setq start (vlax-curve-getstartPoint obj2))
    (setq end (vlax-curve-getendPoint obj2))
    (setq d1 (distance pt start))
    (setq d2 (distance pt end))
    (if (> d1 d2)
    (setq tmp start
    start end
    end tmp
    )