Routine to orient lines

Discussion in 'AutoCAD' started by Neil Wilson, Feb 5, 2004.

  1. Neil Wilson

    Neil Wilson Guest

    I need to orient my linework so that the begin and end points of selected
    lines are all uniform (ie...delta x>0, delta y<0, etc.). I am not proficient
    in LISP or VB and would have to invest a considerable amount of time to
    develop the routine. I am sure someone has made a routine to do this. Would
    anyone be willing to share it or direct me to a site that has such a
    routine?

    Also, is there any way to graphically show which direction the lines are
    drawn?
     
    Neil Wilson, Feb 5, 2004
    #1
  2. Neil Wilson

    Neil Wilson Guest

    I should have investigated Quick Select before posting. I have a solution
    now.

    Thank you.
     
    Neil Wilson, Feb 5, 2004
    #2
  3. Neil Wilson

    Neil Wilson Guest

    It turns out that I do need help with this afterall. Using quickselect I can
    filter objects according to their Delta x or Delta y coordinates. I can then
    reverse the lines easily using the flip command in Land Desktop. However,
    this command does not work on arcs. Therefore, my request is for a routine
    to reverse the direction of an arc segment without changing it's geometry
    (ie...reverse the start x or start y coordinates).

    Any guidance is appreciated.
     
    Neil Wilson, Feb 5, 2004
    #3
  4. Neil Wilson

    dean_bourke Guest

    I don't know if that is possible.
    An arc is defined by CENTRE, RADIUS, START ANGLE and END ANGLE (in radians). Therefore I don't think you can reverse an arc. Turning it into a polyine may be some help.
    BTW, why do you need to reverse it, maybe there is another solution?

    Dean
     
    dean_bourke, Feb 6, 2004
    #4
  5. Neil Wilson

    rdi Guest

    Do a google search for "RPoly". It reverses the direction of a polyline.
    Once you have that--do

    (command ".pedit" arcent "y" "x") ;This'll convert it to polyline
    Run RPoly--not sure how to pass it the entity
    then explode the polyline back down to arc.
     
    rdi, Feb 6, 2004
    #5
  6. Neil Wilson

    Neil Wilson Guest

    If you select an arc and view the list output, you will see that it has a
    start and end coordinate which define it's "direction". I need to control
    the direction for street address geocoding, which depends on the line
    direction to determine which side is left or right (even addresses on
    left, odd on right for example). If the start and end coordinates of an arc
    are reversed without changing the other parameters, then the arc would keep
    the correct geometry but the "direction" would be reversed. Thus the "left"
    and "right" sides would be flipped.

    I see another post about converting the arcs to polylines and reversing them
    with a utility called RPOLY. I will be looking into this, but if there is a
    way to modify the arc without converting it to a polyline, I would prefer
    that solution.

    radians). Therefore I don't think you can reverse an arc. Turning it into a
    polyine may be some help.
     
    Neil Wilson, Feb 6, 2004
    #6
  7. Neil Wilson

    Neil Wilson Guest

    I found RPoly and it does reverse the arc if it is converted into a
    polyline. I can work with it as long as I leave the arc as a polyline.
    However, if I have to explode the polyline the arc reverts back to it's
    original orientation. This is a problem as I do occasionally have to explode
    my linework during editing. It would be cumbersome to have to go through my
    linework again to re-orient the arcs after exploding the polylines. I really
    need to modify the arc entity.

    I was looking for a routine to reverse polylines, so your reply is very
    helpful.

    Thank you
     
    Neil Wilson, Feb 6, 2004
    #7
  8. Neil Wilson

    Neil Wilson Guest

    I was incorrect about seeing the end coordinates using "list". The end
    coordinates can be viewed in the properties viewer under geometry.
     
    Neil Wilson, Feb 6, 2004
    #8
  9. Neil Wilson

    Jeff Mishler Guest

    Neil, an arc, as defined by Autocad, is ALWAYS drawn countrclockwise.
    Therefor, even though you can list the start & endpoints, they are not
    modifiable. The start and end angles can be modified, but it results in
    an arc that is (360deg - original_arc_delta). So I would say that you
    need to leave/make all linework as polylines.

    Jeff

    BTW, here is the arc description as written in the Developer's guide:
    An arc is always drawn counterclockwise from the start point to the
    endpoint. The StartPoint and EndPoint properties of an arc are
    calculated through the StartAngle, EndAngle, and Radius properties.
     
    Jeff Mishler, Feb 8, 2004
    #9
  10. Neil Wilson

    dean_bourke Guest

    I am using ACAD2004, and when I LIST an arc I get this:

    ARC Layer: "0"
    Space: Model space
    Handle = 9B
    center point, X= 49.9744 Y= -32.7696 Z= 0.0000
    radius 59.7602
    start angle 117
    end angle 147
    length 30.5231

    The PROPERTIES box does show a start and and end point but I believe the direction of the arc is determined by center,radius,start angle and end angle - always in the direction specified in the UNITS command. You may have some luck converting the arc to a polyine.
    Some short tests I have run indicate that the vertices do indeed reverse when mirrored for example, but when exploded the arc always returns to it's original data.

    Dean
     
    dean_bourke, Feb 8, 2004
    #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.