southwood1990 Posted June 25, 2012 Posted June 25, 2012 Hi All i have a problem, dont know if anyone can help, i have 43 drawings done by someone else that i need to change all the circles (and there is thousands of them) to either nodes or points and was hoping there may be a lisp to help. the holes are not uniform and quite random. Cheers Mark Quote
southwood1990 Posted June 25, 2012 Author Posted June 25, 2012 Hi All i have 43 drawings, done by someone else and need to change all the circles to nodes or points. there is thousands of them and they are random over the drawing, does anyone know if there is a lisp to do this. Cheers Mark Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 Not sure that understand - do you want to replace all circle entities with point entities? What do you mean by nodes? For me that means the Osnap mode used to locate point entities. Quote
BlackBox Posted June 25, 2012 Posted June 25, 2012 I too have a similar understanding of the OP's request, Mircea. Perhaps the OP will provide more detailed information as to what criteria may be used to either create a selection set, or iterate the potential DBXDocuments, such as layer, etc.. Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 By the way, there is no need to multiply the post (#1, #2); it will just split the discussion. Please ask a moderator to remove the other ones. Quote
Dadgad Posted June 25, 2012 Posted June 25, 2012 Welcome to the forum. Depending on why you need to do this, and how they will be used, it could be as simple as this. Open a drawing, turn on your QUICK PROPERTIES (or Properties). CTRL+A (select all). By using the dropdown menu you can choose the CIRCLES. This is just an easy way to FILTER all of the circles from the numerous other entities in the drawing. In quick properties (as shown in first image radii varies) you can see the dimensions of all the circles. As they are not all of the same size the fields indicate VARIES. You can click into either the RADIUS or DIAMETER field and enter a very small value, then hit ENTER. All of the circles will be reduced to such a scale that they will display as points. You may need to adjust that new dimension, to a larger one than I used in the example, to ensure that it will display when printing. Barring that I am sure someone will supply a lisp, just thought I would throw this quick fix out, in case it would be helpful. Quote
southwood1990 Posted June 25, 2012 Author Posted June 25, 2012 Thanks for the reply the only problem is i have to use the data in a cad cam environment, and it is going to know if it is a point or very small circle and it will try and machine it rather than drill it. Quote
southwood1990 Posted June 25, 2012 Author Posted June 25, 2012 node not the best description, will need to be points, as i have to run this through a cad cam program. Quote
Dadgad Posted June 25, 2012 Posted June 25, 2012 Good luck buying a drill bit that size, SEARS won't have it! Somebody will fix you up, sorry this didn't do it, and I understand. Lisp is the way to go. Good luck with it. Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 This tool will replace all circles from your drawing with point entities, preserving original features: ;Replace Circles with Points (25-VI-2012) (defun c:RCP( / );ssetCircles countCircles itemCircle assocCircle assocPoint ) (if (setq ssetCircles (ssget "_X" '((0 . "CIRCLE")))) (repeat (setq countCircles (sslength ssetCircles)) (setq itemCircle (ssname ssetCircles 0) assocCircle (entget itemCircle) assocPoint '((0 . "POINT"))) (foreach codeDXF '(10 8 410 210) (setq assocPoint (append assocPoint (list (assoc codeDXF assocCircle)))) ) (if (assoc 62 assocCircle) (setq assocPoint (append assocPoint (list (assoc 62 assocCircle))))) (if (assoc 6 assocCircle) (setq assocPoint (append assocPoint (list (assoc 6 assocCircle))))) ;??? (entmakex assocPoint) (ssdel itemCircle ssetCircles) (entdel itemCircle) ) ) (prompt (strcat "\nReplaced " (itoa countCircles) " circles.")) (princ) ) Quote
Dadgad Posted June 25, 2012 Posted June 25, 2012 This tool will replace all circles from your drawing with point entities, preserving original features:;Replace Circles with Points (25-VI-2012)(defun c:RCP( / ) That didn't take too long!You've likely made the OP's day.Masterfully done Mircea. Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 Thank you for your comments, Dadgad, but is just a simple code. Have a nice day, my friend! Quote
Tharwat Posted June 25, 2012 Posted June 25, 2012 (edited) Maybe this .... ? codes removed Edited June 25, 2012 by Tharwat Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 Tharwat, that code will relocate the circles on points in a totally arbitrary order. How this solution is applicable in a technical drawing, where location of the holes (OP is talking about CAM processing) is mandatory?!? Quote
Tiger Posted June 25, 2012 Posted June 25, 2012 By the way, there is no need to multiply the post (#1, #2); it will just split the discussion. Please ask a moderator to remove the other ones. Threads are now merged. Quote
Lee Mac Posted June 25, 2012 Posted June 25, 2012 My version: (defun c:c2p ( / e i s ) (if (setq s (ssget "_X" '((0 . "CIRCLE")))) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i))))) (if (entmake (list '(0 . "POINT") (assoc 010 e) (assoc 008 e) (cond ((assoc 006 e)) ('(006 . "BYLAYER"))) (cond ((assoc 039 e)) ('(039 . 0.0))) (cond ((assoc 062 e)) ('(062 . 256))) (cond ((assoc 370 e)) ('(370 . -1))) (assoc 210 e) (assoc 410 e) ) ) (entdel (cdr (assoc -1 e))) ) ) ) (princ) ) Quote
Tharwat Posted June 25, 2012 Posted June 25, 2012 Mircea Could you please tell me what is the CAM processing ? Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 My version: ... (cond ((assoc 006 e)) ('(006 . "BYLAYER"))) (cond ((assoc 039 e)) ('(039 . 0.0))) (cond ((assoc 062 e)) ('(062 . 256))) (cond ((assoc 370 e)) ('(370 . -1))) ... Lee, I really like this approach! Quote
MSasu Posted June 25, 2012 Posted June 25, 2012 Could you please tell me what is the CAM processing ? That stands for Computer Aided Manufacturing – if you follow all posts, seems that OP is looking to send the sketch to a machine in his/her shop for mechanical processing. If the holes are relocated, then the final result is useless. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.