See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Points to Circles

  1. #1
    Member
    Join Date
    2003-04
    Location
    Hyderabad,Andhra Pradesh,India
    Posts
    15
    Login to Give a bone
    0

    Default Points to Circles

    Hello,

    I am having 1000's of points in Auto cad File.

    I want to convert these all points to cirlces with single command.Anybody can help me if you know or having lisp file at your side.If you provide this file I may be save lot of time.

    Thanks,
    Vijay

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Points to Circles

    Quote Originally Posted by vijaybaskergundla View Post
    Hello,

    I am having 1000's of points in Auto cad File.

    I want to convert these all points to cirlces with single command.Anybody can help me if you know or having lisp file at your side.If you provide this file I may be save lot of time.

    Thanks,
    Vijay
    Are they actual autocad "points"?
    Do you want actual circles or just have them appear as circles?

    If you want them to just appear as circles, change the variable PDMODE to 32 or 33.
    And then do a "REGENALL"
    (look into the variables DDPTYPE, PDMODE and PDSIZE)



    If you want actual circles, maybe someone has a lisp routine, (it sounds do-able).

  3. #3
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Points to Circles

    are the points a block that contain a point? if so, you could redefine the block.

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Points to Circles

    Here is a quick stab at it...

    Code:
    
    (setq sset (ssget "_X" '((0 . "POINT"))) i 0)
    (if sset
      (repeat (sslength sset)    
        (setq ent (ssname sset i))
        (entmake
          (list
            (cons 0 "CIRCLE")
            (cons 10 (cdr (assoc 10 (entget ent))))
            (cons 40 10.0) ;circle size, change the 10.0 to whatever you want
          )
        )
        (entdel ent)
        (setq i (1+ i))
      )
    )
    
    R.K. McSwain | CAD Panacea |

  5. #5
    I could stop if I wanted to
    Join Date
    2007-08
    Posts
    202
    Login to Give a bone
    0

    Default Re: Points to Circles

    Hi,

    You can see this 'challenge' at the TheSwamp, there was many replys in many prog languages.

  6. #6
    Member
    Join Date
    2003-04
    Location
    Hyderabad,Andhra Pradesh,India
    Posts
    15
    Login to Give a bone
    0

    Default Re: Points to Circles

    Thanks a LOT,It is working and useful to us.

    But can u give it as in lisp file,Actually I copied this code and pasted in Auto cad command prompt,all points are changed to circles,its OK.Instead of that If I use with command,it may be very convent,So If it is possible Can u give me with Lisp DEFUN CODE.

    Thanks,
    Vijay




    Quote Originally Posted by rkmcswain View Post
    Here is a quick stab at it...

    Code:
    
    (setq sset (ssget "_X" '((0 . "POINT"))) i 0)
    (if sset
      (repeat (sslength sset)    
        (setq ent (ssname sset i))
        (entmake
          (list
            (cons 0 "CIRCLE")
            (cons 10 (cdr (assoc 10 (entget ent))))
            (cons 40 10.0) ;circle size, change the 10.0 to whatever you want
          )
        )
        (entdel ent)
        (setq i (1+ i))
      )
    )
    

  7. #7
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Points to Circles

    Code:
    (defun c:pt2cir ()
    (setq sset (ssget "_X" '((0 . "POINT"))) i 0)
    (if sset
      (repeat (sslength sset)    
        (setq ent (ssname sset i))
        (entmake
          (list
            (cons 0 "CIRCLE")
            (cons 10 (cdr (assoc 10 (entget ent))))
            (cons 40 10.0) ;circle size, change the 10.0 to whatever you want
          )
        )
        (entdel ent)
        (setq i (1+ i))
      )
    )
    (princ)
    )
    (prompt "\n TYPE PT2CIR at the command line")
    Attached Files Attached Files
    Last edited by Opie; 2008-12-20 at 11:52 AM. Reason: [code] tags added

  8. #8
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Points to Circles

    To erase all points in the selection set after the repeat loop, reduce the time with more than 40 % compared to erase all points one by one in the repeat loop.


    : ) Happy Computing !

    kennet

  9. #9
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Points to Circles

    Obviously, there are many ways to reduce the process time... as evidenced by the thread over in the swamp (referenced above...). In most cases, unless you are operating on hundreds of thousands of entities, the time spend to optimize such code is much greater than what would be saved...
    R.K. McSwain | CAD Panacea |

  10. #10
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Points to Circles

    Quote Originally Posted by rkmcswain View Post
    Obviously, there are many ways to reduce the process time... as evidenced by the thread over in the swamp (referenced above...). In most cases, unless you are operating on hundreds of thousands of entities, the time spend to optimize such code is much greater than what would be saved...
    yes, that is true . . .

    (entdel ent) or (command "._erase" sset "" )


    : ) Happy Computing !

    kennet

Page 1 of 2 12 LastLast

Similar Threads

  1. circles within circles...
    By IamMichaelPacker747327 in forum AutoCAD General
    Replies: 9
    Last Post: 2012-04-30, 08:03 PM
  2. Circles Masking
    By ekolto in forum AutoCAD General
    Replies: 3
    Last Post: 2011-10-25, 07:33 PM
  3. Circles & Boxes.....
    By ronie_ernanto in forum AutoCAD Gallery
    Replies: 13
    Last Post: 2009-05-05, 09:03 AM
  4. Replies: 0
    Last Post: 2007-04-27, 08:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •