Arc to Polyline bulge

Discussion in 'AutoCAD' started by GARYNTX, Nov 5, 2004.

  1. GARYNTX

    GARYNTX Guest

    I've found a lot of lisp routines for calculating the centerpoint, radius and included angle of an arc from the two points and the bulge factor of a polyarc. But I can't seem to find a routine to go in reverse.
    Does anyone have something that I can get the two points and the bulge factor from inputing the centerpoint, radius and included angle.
     
    GARYNTX, Nov 5, 2004
    #1
  2. GARYNTX

    BillZ Guest

    Here's one that will give you the bulge factor of the picked arc.

    Code:
    ;03-05-03
    ;Bill Zondlo
    ;program to pick arc and get bulge
    ;
    ;
    ;
    ;
    ;---------;
    (defun c:bulge_of_arc ()
    ;-------------------;
    (setq e 1)                                                     ;select first entity.
    (while e
    (setq en1 (car (entsel "\nSelect arc"))
    )
    (cond ((null en1)
    (prompt "\nNot a Arc.")                             ;loops for null pick.
    )
    ((= (cdr (assoc 0 (entget en1))) "ARC")                ;must be arc.
    (setq e nil
    pt1 (cdr (assoc 10 (entget en1)))
    an1 (cdr (assoc 50 (entget en1)))
    an2 (cdr (assoc 51 (entget en1)))
    2pi (* pi 2.0)
    )
    )                                                    ;end list
    )                                                           ;end cond.
    )                                                             ;end while.
    ;------------------;
    ;------------------;
    (setq aa (- an1 an2)                                             ;deflection (included) angle
    )
    (if (not (minusp aa))                                            ;minus is the included (inside) angle.
    (setq aa (- 2pi aa))
    )
    (setq testa aa
    aa (abs (/ aa 4.0))                                         ;you need the tangent of this angle (bulge factor).
    bulge_1 (* (/ 1.0 (cos aa))(sin aa))                        ;tangent of 1/4 included angle or bulge.
    )
    ;------------------;
    )                                                                ;end defun
    

    Bll
     
    BillZ, Nov 5, 2004
    #2
  3. GARYNTX

    GARYNTX Guest

    Thanks Bill for the conversion routine I could use that in the future........I think I am going about this the wrong way entirely.

    What I was trying to do was select an existing hatch and the routine would draw the boundary around it.

    I have drawings that have hatches with no boundaries. If I make a change to the drawing and want to change the hatch. I don't want to have to redraw the hatch all over again. I just want to get the existing boundary and reselect the interior points. Is there another way of doing this or a lisp file for this.
    I'm trying to extract the information from the hatch and either entmake or redraw the polyline. I start getting into trouble when there are arcs involved. Any help would be much appreciated.
     
    GARYNTX, Nov 5, 2004
    #3
  4. http://www.jtbworld.com/lisp/hatchb.htm

    --
    Autodesk Discussion Group Facilitator



    would draw the boundary around it.
     
    Jason Piercey, Nov 5, 2004
    #4
  5. GARYNTX

    GARYNTX Guest

    WOW! I should have asked that in the first place. That is a DEFINATE time saver.....Thanks.
     
    GARYNTX, Nov 5, 2004
    #5
  6. Send Jimmy an email and say thanks.... :)

    --
    Autodesk Discussion Group Facilitator



    time saver.....Thanks.
     
    Jason Piercey, Nov 5, 2004
    #6
  7. GARYNTX

    GTVic Guest

    GTVic, Nov 6, 2004
    #7
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.