Reversing line direction

Discussion in 'AutoCAD' started by HJV, Aug 10, 2005.

  1. HJV

    HJV Guest

    We are using a custom linestyle that has text imbedded in it. The problem is
    when the line is drawn for point A to point B the linestyle is shown
    correctly, but, when the line is drawn from point B to point A the text
    within the linestyle is upside down.
    Is there a utility available that will allow me to easily change the
    direction of the line.

    Thank you inadvance for your help.

    Dave
     
    HJV, Aug 10, 2005
    #1
  2. HJV

    Paul Turvill Guest

    Paul Turvill, Aug 10, 2005
    #2
  3. Try this:
    -------------------------------------------------------
    (defun C:bw (/ first list1 pt1 pt2)
    (setvar "cmdecho" 0)
    (command "undo" "be")
    (setq first (car
    (entsel
    "\nPick the line to be reversed:"
    )
    )
    )
    (setq list1 (entget first)
    pt1 (cdr (assoc 10 list1))
    pt2 (cdr (assoc 11 list1))
    )
    (progn
    (setq list1 (subst (cons 10 pt2) (assoc 10 list1) list1)
    list1 (subst (cons 11 pt1) (assoc 11 list1) list1)
    )
    (entmod list1)
    )
    (princ)
    )
     
    Michael Bulatovich, Aug 10, 2005
    #3
  4. Much nicer than my "quickie"!
    Does all kinds of objects, but I'm getting weird action
    with circles. (I didn't know that circles had a direction)
     
    Michael Bulatovich, Aug 10, 2005
    #4

  5. "Wierd Action": When you explode back to an arc the direction goes back to
    the original. See F2 below.

    Command: li
    LIST
    Select objects: 1 found

    Select objects:
    CIRCLE Layer: 0
    Space: Model space
    Color: BYLAYER Linetype: SLOPE
    Handle = 4C
    center point, X= 5.5722 Y= 5.3278 Z= 0.0000
    radius 1.9346
    circumference 12.1553
    area 11.7577


    Command: plrev

    Pick an object to reverse:

    *Invalid selection*
    Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
    Select polyline:
    Object selected is not a polyline
    Do you want to turn it into one? <Y> y

    Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo/eXit <X>:

    Command:
    PLREV
    Pick an object to reverse:

    Command: li
    LIST
    Select objects: 1 found

    Select objects:
    LWPOLYLINE Layer: 0
    Space: Model space
    Color: BYLAYER Linetype: SLOPE
    Handle = 68
    Open
    Constant width 0.0000

    at point X= 7.4061 Y= 4.7119 Z= 0.0000
    bulge -4239.0857
    center X= 5.5722 Y= 5.3278 Z= 0.0000
    radius 1.9346
    start angle 341
    end angle 341
    at point X= 7.4067 Y= 4.7137 Z= 0.0000

    area 11.7577
    length 12.1535


    Command: ex
    EXPLODE
    Select objects: 1 found

    Select objects:

    Command: li
    LIST
    Select objects: 1 found

    Select objects:
    ARC Layer: 0
    Space: Model space
    Color: BYLAYER Linetype: SLOPE
    Handle = 69
    center point, X= 5.5722 Y= 5.3278 Z= 0.0000
    radius 1.9346
    start angle 341
    end angle 341
    length 12.1535
     
    Michael Bulatovich, Aug 10, 2005
    #5
  6. HJV

    Paul Turvill Guest

    ARCs and CIRCLEs are always counterclockwise in AutoCAD. The only way to
    keep a "reversed" CIRCLE or ARC is to let it remain as Polyline Arc
    segment(s). PLREV converts CIRCLEs and ARCs to Polylines, as you have
    noticed. To keep them "reversed" do NOT EXPLODE them.
    ___
     
    Paul Turvill, Aug 10, 2005
    #6
  7. I looked at the code and figured that out. Pretty clever.
    You must use a bunch of complex linetypes to make
    writing all that code worth it. The issue has never really
    come up for me in my work.
     
    Michael Bulatovich, Aug 11, 2005
    #7
  8. HJV

    Paul Turvill Guest

    No, but I have dealt with several C.E. firms who do. We trade in goodwill
    and other good stuff.
    ___
     
    Paul Turvill, Aug 11, 2005
    #8
  9. Are you structural?

     
    Michael Bulatovich, Aug 11, 2005
    #9
  10. HJV

    Paul Turvill Guest

    No, mechanical with a lot of experience in architecture. Before that
    (believe it or not) I was a heavy-duty truck designer.
    ___
     
    Paul Turvill, Aug 11, 2005
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.