Removing Extrusion Lisp Routine?

Discussion in 'AutoCAD' started by Jorge Z, Apr 9, 2004.

  1. Jorge Z

    Jorge Z Guest

    I have alot of arcs that have an extrusion of -1 Example:

    I'm not sure of how to remove this Extrusion direction on my arcs. Has
    anyone ever encountered this?

    ARC Layer: "ditch"
    Space: Model space
    Handle = C27
    center point, X=6507723.8036 Y=2046681.3594 Z= 0.0000
    radius 39.0000
    Extrusion direction relative to UCS:
    X= 0.0000 Y= 0.0000 Z= -1.0000
    length 60.1879
    total angle 88

    Does anyone have a lisp that would remove this? or know of a command
    sequence?
     
    Jorge Z, Apr 9, 2004
    #1
  2. Jorge Z

    Rudy Tovar Guest

    Are you talking about the setvar "thickness" variable?
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Apr 9, 2004
    #2
  3. Jorge Z

    mataeux Guest

    (command "._UCS" "_FRONT")
    (command "._MIRROR" "_SI" (ssget"X"'((210 0 0 -1))) '(0 0)'(1 0)"_YES")
    (command "._UCS" "_PREVIOUS")
     
    mataeux, Apr 9, 2004
    #3
  4. Jorge Z

    Jamie Duncan Guest

    (defun c:fixarcs (/ ss1 end1 ctr ext1 ptx pty ptz)
    (setq ss1 (ssget "X" '((0 . "ARC"))) ctr 0)
    (repeat (sslength ss1)
    (setq end1 (entget (ssname ss1 ctr))
    ctr (+ 1 ctr)
    ext1 (cdr (assoc 210 end1))
    ptx (car ext1)
    pty (cadr ext1)
    ptz (caddr ext1)
    )
    (if (< ptz 0)
    (progn
    (setq ext1 (list ptx pty (abs ptz))
    end1 (subst (cons 210 ext1)(assoc 210 end1) end1)
    )
    (entmod end1)
    )
    )
    )
    )


    does this help?



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 10, 2004
    #4
  5. Jorge Z

    Jamie Duncan Guest

    'course this effectively mirrors 3d all the arcs that have a negative
    zfactor


    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 10, 2004
    #5
  6. (defun ALE_FIX_210 ( / ss1 group_len obj_temp ent_temp out_flag)
    (if
    (setq ss1 (ssget "X" (list
    (cons 0 (strcat
    "TRACE,TOLERANCE,TEXT,SPLINE,SOLID,SHAPE,POLYLINE,POINT,"
    "MTEXT,MLINE,LWPOLYLINE,LINE,LEADER,INSERT,HATCH,ELLIPSE,"
    "CIRCLE,ATTRIB,ATTDEF,ARC"
    ) )
    ) ) )
    (progn
    (setq group_len (sslength ss1))
    (while (> group_len 0)
    (setq
    obj_temp (ssname ss1 (setq group_len (1- group_len)))
    ent_temp (entget obj_temp)
    )
    (if (> (cadddr (assoc 210 ent_temp)) 0) (ssdel obj_temp ss1))
    )
    (if (> (setq group_len (sslength ss1)) 0)
    (progn
    (command
    "._UNDO" "_GROUP"
    "._UCS" "_3P" "_NONE" (trans '(0 0 0) 0 1)
    "_NONE" (trans '(0 1 0) 0 1) "_NONE" (trans'(0 0 1) 0 1)
    "._MIRROR" ss1 "" "_NONE" '(0 0 0) "_NONE" '(1 0 0) "_YES"
    "._UCS" "_P" "._UNDO" "_END"
    )
    (setq out_flag T)
    )
    )
    )
    )
    out_flag
    )

    --
    ________________________________________________

    Marc'Antonio Alessi (TV) Italy
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    O.S. = XP Pro 2002 Ita - Sp.1
    AutoCAD = 2004 Ita - Sp.1a
    ________________________________________________
     
    Marc'Antonio Alessi, Apr 11, 2004
    #6
  7. Jorge Z

    RaghuMN Guest

    Hi all,

    I too have the same problem. I need the arcs that are not extruded in any direction w.r.t XY plane, i.e., perfect 0,0,1 condition.

    Solutions given by Jamie Duncan / Jeff Misher / Marc does not fix my problem.

    My ARCs have different extrusions, not only in Z direction, but also in other directions.

    My requirement is that the values for dxf code 210 must be (0,0,1) only.

    Hence, I wrote 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)
    )
    )
    )
    ;(command "list" (entlast) snam "")(getstring)
    (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 13, 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.