Donut lisp routine...

Discussion in 'AutoCAD' started by Beaudin, Jan 29, 2004.

  1. Beaudin

    Beaudin Guest

    Hi all.

    I am looking for a lisp routine that will allow me to select all Donut objects in a drawing and change the outer diameter and inner diameter to my own specifications.

    If anyone can help me out, I'd appreciate it!

    Blaker
     
    Beaudin, Jan 29, 2004
    #1
  2. Beaudin

    Paul Turvill Guest

    HINT: "donuts" are just closed, wide polylines made up of two 180 deg. arc
    segments.
    ___

    objects in a drawing and change the outer diameter and inner diameter to my
    own specifications.
     
    Paul Turvill, Jan 29, 2004
    #2
  3. Beaudin

    ECCAD Guest

    Just a suggestion:
    Since the donuts are LWPOLYLINES, but treated as a 'unit' when selected, you could get the 'center' point, and 'scale' them up or down.

    Bob
     
    ECCAD, Jan 29, 2004
    #3
  4. Not if the adjustments of the inner/outer diameters are different.

    --

    -Jason
    Member of the Autodesk Discussion Forum Moderator Program


    the 'center' point, and 'scale' them up or down.
     
    Jason Piercey, Jan 29, 2004
    #4
  5. Beaudin

    ECCAD Guest

    Yes,
    Forgot about 'specifying'. You could grab the donut, get the center point, prompt for new inner and outer dia., then delete the 'old' donut, and construct a 'new' donut using the same center point ?
    Bob
     
    ECCAD, Jan 29, 2004
    #5
  6. Yes, although you will have to calculate the
    center point from the existing vertices.

    --

    -Jason
    Member of the Autodesk Discussion Forum Moderator Program


    then delete the 'old' donut, and construct a 'new' donut using the same center point ?
     
    Jason Piercey, Jan 29, 2004
    #6
  7. Beaudin

    ECCAD Guest

    Your are right, based on following screen dump, the 'center' is not in there, except is listed on screen with 'list'.

    Command: list
    Select objects: 1 found

    Select objects:
    LWPOLYLINE Layer: "0"
    Space: Model space
    Color: BYLAYER Linetype: "CONTINUOUS"
    Handle = 90
    Closed
    Constant width 0.7500
    area 1.2272
    perimeter 3.9270

    at point X= 4.8125 Y= 12.5000 Z= 0.0000
    bulge 1.0000
    center X= 5.4375 Y= 12.5000 Z= 0.0000
    radius 0.6250
    start angle 180
    end angle 0
    at point X= 6.0625 Y= 12.5000 Z= 0.0000
    bulge 1.0000
    center X= 5.4375 Y= 12.5000 Z= 0.0000
    radius 0.6250
    start angle 0
    end angle 180

    Command: (setq obj (ssget))

    Select objects: 1 found

    Select objects: <Selection set: 2>

    Command: (setq ent (ssname obj 0))
    <Entity name: 40081f40>

    Command: (setq don (entget ent))
    ((-1 . <Entity name: 40081f40>) (0 . "LWPOLYLINE") (330 . <Entity name:
    40081cc0>) (5 . "90") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0")
    (6 . "Continuous") (100 . "AcDbPolyline") (90 . 2) (70 . 1) (43 . 0.75) (38 .
    0.0) (39 . 0.0) (10 4.8125 12.5) (40 . 0.75) (41 . 0.75) (42 . 1.0) (10 6.0625
    12.5) (40 . 0.75) (41 . 0.75) (42 . 1.0) (210 0.0 0.0 1.0))

    Worse yet, the dfx 10 code is listed twise.
    Bummer.
    Bob
     
    ECCAD, Jan 29, 2004
    #7
  8. Beaudin

    Paul Turvill Guest

    .... or apply a kludge like:
    (osnap (cdr (assoc 10 (entget obj))) "cen")

    where obj is the name of the donut.
    ___
     
    Paul Turvill, Jan 29, 2004
    #8
  9. Yep, one for each vertex (just like all lwpolylines)
     
    Jason Piercey, Jan 29, 2004
    #9
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.