View Full Version : Points to Circles
vijaybaskergundla
2008-12-19, 11:05 AM
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
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).
ccowgill
2008-12-19, 02:09 PM
are the points a block that contain a point? if so, you could redefine the block.
rkmcswain
2008-12-19, 06:27 PM
Here is a quick stab at it...
(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))
)
)
'gile'
2008-12-19, 07:06 PM
Hi,
You can see this 'challenge' (http://www.theswamp.org/index.php?topic=26243.0) at the TheSwamp, there was many replys in many prog languages.
vijaybaskergundla
2008-12-20, 06:53 AM
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
Here is a quick stab at it...
(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))
)
)
devitg.89838
2008-12-20, 08:29 AM
(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")
kennet.sjoberg
2008-12-21, 03:52 PM
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
rkmcswain
2008-12-21, 09:29 PM
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...
kennet.sjoberg
2008-12-21, 09:45 PM
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
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.