Fixing Extruded Arcs

Discussion in 'AutoCAD' started by RaghuMN, Apr 16, 2004.

  1. RaghuMN

    RaghuMN Guest

    Hi all,

    I have enormous ARCs are extruded in all the 3 directions (X, Y and Z directions).
    I need the ARCs that are NOT extruded in any direction w.r.t XY plane, i.e., perfect 0,0,1 condition.

    W.r.t solutions given by Jamie Duncan / Jeff Misher / Marc in http://discussion.autodesk.com/thread.jspa?threadID=326090
    does not fix my problem. I tried posting the same question in this thread, but, probably went unnoticed. Hence, I have repeated this.

    Fixing extrusion of Lines works out with http://discussion.autodesk.com/thread.jspa?messageID=2734895, but not for ARCs. I could not continue this thread since my data was not so bad.

    Since my requirement is that the values for dxf code 210 must be (0,0,1) only, I thought of redrawing new arcs over the extruded ones.
    Hence, I made a small program that redraws a new arc on the current extruded arc, capturing the radius, start ang, end ang and center point details of the current arc.

    But, I notice that the new arc has a different coordinates than the original.
    Also, after executing this program, when I zoom to some other location and return back, the original arcs will be distorted!

    Both the program and the sample listing of New and Old arcs are given below.

    My doubt lies on the start angle and end angle of the original arc.
    Am I getting the start\end angles that lies oblique to the XY plane when I extract from the details?
    If so, what should I do to get these angles w.r.t XY plane?

    Or, where else my program is wrong?

    Please suggest.

    Thanks,
    MNRaghu
    --------------------------------- ------my source code with error

    (defun c:fix_arcs();/ sset no snam 210_val sdets sangval eangval cpt iang)
    (if (setq sset (ssget "x" (list (cons 0 "ARC"))))
    (progn
    (setq no 0 ctr 0)
    (while (setq snam (ssname sset no))
    (princ "\nFixing ")(princ (1+ no))(princ " of ")(princ (sslength sset))(princ " ")
    (if (not (equal (setq 210_val (cdr (assoc 210 (entget snam)))) (list 0 0 1)))
    (progn
    (setq sdets (entget snam) ;snam details
    radval (cdr (assoc 40 sdets)) ;radius value
    sangval (cdr (assoc 50 sdets)) ;start angle
    eangval (cdr (assoc 51 sdets)) ;end angle
    cpt (cdr (assoc 10 sdets)) ;center point
    iang (abs (- sangval eangval)) ; included angle
    p1 (polar cpt sangval radval) ; start point
    p2 (polar cpt eangval radval) ; end point
    lyr (cdr (assoc 8 sdets)) ;arc layer
    clr (cdr (assoc 62 sdets)) ;arc colour
    )
    (if clr
    (entmake (list (cons 0 "ARC")(cons 10 cpt)(cons 40 radval)
    (cons 50 sangval)(cons 51 eangval)
    (cons 8 lyr)(cons 62 clr)
    )
    )
    (entmake (list (cons 0 "ARC")(cons 10 cpt)(cons 40 radval)
    (cons 50 sangval)(cons 51 eangval)
    (cons 8 lyr)
    )
    )
    )
    (if (> ctr 0)
    (princ (strcat (itoa ctr) " ARCs fixed for extrusion."))
    (princ "\nNo ARCs fixed for extrusion.")
    )
    )
    )
    (setq no (1+ no))
    )
    )
    (princ "\nNo ARCs found!")
    )
    (princ "\nDone.")(princ)
    )

    ---------------------------------------listing of new and old arcs after program is executed

    Listing of Original ARC:

    ARC Layer: "PARC-AAT"
    Space: Model space
    Handle = 25FB
    center point, X=6790030.0395 Y=1989568.7314 Z= 46.6047 <-------Look at this
    radius 598.3068
    Extrusion direction relative to UCS:
    X= 0.0001 Y= 0.0458 Z= 0.9989
    length 34.4253
    total angle N 86d42'12" E

    Listing of New ARC:
    ARC Layer: "PARC-AAT"
    Space: Model space
    Handle = 26DF
    center point, X=-6785574.5589 Y=-2002601.9816 Z=91950.4525 <-------Look at this
    radius 598.3068
    start angle N 53d32'39" E
    end angle N 50d14'51" E
    length 34.4253
     
    RaghuMN, Apr 16, 2004
    #1
  2. RaghuMN

    BillZ Guest

    RaghuMN,

    I don't know if that can be done.
    The extrusion direction of the arc determines what the coordinates of the arc are in relation to the center point.
    If you change the extrusion direction you basically change the UCS that the arc resides in.

    Draw an arc in a ucs other than world.
    Then:
    Command: (setq ent (entlast))
    <Entity name: 7ef57e98>

    Command: (setq nens (entget ent))
    ((-1 . <Entity name: 7ef57e98>) (0 . ARC) (330 . <Entity name:
    7ef57cf8>) (5 . 8B) (100 . AcDbEntity) (67 . 0) (410 . Model) (8 . 0) (100 .
    AcDbCircle) (10 24.2767 8.63053 0.0) (40 . 5.11289) (210 0.207912 -0.691655
    0.691655) (100 . AcDbArc) (50 . 0.0785494) (51 . 3.39796))

    Note the assoc 210.
    Now:
    Command: (setq nens (subst (cons 210 (list 0 0 1))(assoc 210 nens) nens))
    ((-1 . <Entity name: 7ef57e98>) (0 . "ARC") (330 . <Entity name: 7ef57cf8>) (5
    "8B") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbCircle") (10 24.2767 8.63053 0.0) (40 . 5.11289) (210 0 0 1) (100 .
    "AcDbArc") (50 . 0.0785494) (51 . 3.39796))

    And:

    Command: (entmod nens)
    ((-1 . <Entity name: 7ef57e98>) (0 . "ARC") (330 . <Entity name: 7ef57cf8>) (5
    "8B") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbCircle") (10 24.2767 8.63053 0.0) (40 . 5.11289) (210 0 0 1) (100 .
    "AcDbArc") (50 . 0.0785494) (51 . 3.39796))

    Note that the arc has aquired a new location on the screen.

    Why does the extrusion direction matter for you?

    HTH

    Bill
     
    BillZ, Apr 16, 2004
    #2
  3. RaghuMN

    mataeux Guest

    any arc that is not normal (not '(210 0 0 ±1)) to the viewing plane will
    appear as an elliptical arc (forshortened) you need to replace it with an
    ELLIPSE object not an ARC object. look into the ellipse command, it may be
    a simple to change your program.




    but, probably went unnoticed. Hence, I have repeated this.
    http://discussion.autodesk.com/thread.jspa?messageID=2734895, but not for
    ARCs. I could not continue this thread since my data was not so bad.
    only, I thought of redrawing new arcs over the extruded ones.
    extruded arc, capturing the radius, start ang, end ang and center point
    details of the current arc.
    return back, the original arcs will be distorted!
     
    mataeux, Apr 16, 2004
    #3
  4. RaghuMN

    RaghuMN Guest

    Thanks for the reply BillZ.

    I have yet to get into the suggestion given by you. I will do it in a day or 2.

    The need to remove this extrusion is that, these data get converted into ESRI coverage format. If such extrusions prevail, the data after conversions become corrupt.
    Also, these extrusions are caused by the conversion process itself. The coverage / shape file data sometimes yields these results, whereas, the data in the original format remains correct. I do not know a way to fix this yet.

    Thanks,

    MNRaghu
     
    RaghuMN, Apr 19, 2004
    #4
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.