philk Posted November 25, 2010 Posted November 25, 2010 Hi, does anyone know how to change roughly 1000 points into actual entities/circles/donuts something i can work with. Quote
eldon Posted November 25, 2010 Posted November 25, 2010 (edited) If you go to the web site of Jeffery P Sanders, there is a lisp called NodeSert which will insert a block at every node in a drawing. If you make a block with entities of your choice, then you can explode all blocks after using the lisp. Edited November 25, 2010 by eldon OOps, I just saw LT, so you can't do the above Quote
Tharwat Posted November 25, 2010 Posted November 25, 2010 Here is mine I have just made it for your purpose . (defun c:Pt2Circles (/ ss) ; Tharwat Nov 25 . 2010 (if (setq ss (ssget "_:L" '((0 . "POINT")))) ((lambda (i / a ) (while (setq a (ssname ss (setq i (1+ i)))) (entmakex (list (cons 0 "CIRCLE") (cons 10 (cdr (assoc 10 (entget a)))) (cons 40 0.2)))[color=red]; <-- You can change the Radius of the Circles[/color] (entdel a) ) ) -1 ) (princ "\nNo points selected") ) (princ) ) Hope you like it . Tharwat Quote
Lee Mac Posted November 25, 2010 Posted November 25, 2010 Are you using LT Philk? If so, LISP will be out of the question. Quote
philk Posted November 25, 2010 Author Posted November 25, 2010 Thanks for the replies very much appreciated. Quote
philk Posted November 25, 2010 Author Posted November 25, 2010 i've got Civil3d 2010 so can run lisp in this Quote
philk Posted November 25, 2010 Author Posted November 25, 2010 Cheers for the reply, altering the point style doesn't really solve the problem, i need to hatch the nodes/circles/points Quote
Tharwat Posted November 25, 2010 Posted November 25, 2010 I did modify my previous routine to meet your needs with Hatch . (defun c:Pt2Circles (/ ss) ; Tharwat Nov 25 . 2010 (if (setq ss (ssget "_x" '((0 . "POINT")))) ((lambda (i / a ss1) (while (setq a (ssname ss (setq i (1+ i)))) (setq ss1 (ssadd)) (ssadd (entmakex (list (cons 0 "CIRCLE") (cons 10 (cdr (assoc 10 (entget a)))) (cons 40 0.2))) ss1) (command "_.-hatch" "_p" "_solid" "_s" ss1 "" "") (entdel a) ) ) -1 ) (princ "\nNo points selected") ) (princ) ) Tharwat Quote
Tharwat Posted November 25, 2010 Posted November 25, 2010 works great thanks Glad you like it. You're welcome any time . Tharwat Quote
Lee Mac Posted November 25, 2010 Posted November 25, 2010 Hi Tharwat, Nice work I would be more inclined to use something like this to retain the layer/linetype/lineweight etc properties of the original points: [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:pt2circles [b][color=RED]([/color][/b] [b][color=BLUE]/[/color][/b] rad ss [b][color=RED])[/color][/b] [i][color=#990099];; © Lee Mac 2010[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] rad [b][color=#009999]0.2[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; Circle Radius[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]ssget[/color][/b] [b][color=#a52a2a]"_:L"[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED](([/color][/b][b][color=#009900]0[/color][/b] [b][color=DARKRED].[/color][/b] [b][color=#a52a2a]"POINT"[/color][/b][b][color=RED]))))[/color][/b] [b][color=RED]([/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b] i [b][color=BLUE]/[/color][/b] e el [b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] e [b][color=RED]([/color][/b][b][color=BLUE]ssname[/color][/b] ss [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b] i[b][color=RED]))))[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] el [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] e[b][color=RED]))[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entmakex[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]apply[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]append[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]subst[/color][/b] [b][color=BLUE]nil[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]50[/color][/b] el[b][color=RED]))[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]list[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]append[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]subst[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]0[/color][/b] [b][color=#a52a2a]"CIRCLE"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]0[/color][/b] el[b][color=RED])[/color][/b] el[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]40[/color][/b] rad[b][color=RED]))[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entdel[/color][/b] e[b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=#009900]-1[/color][/b] [b][color=RED])[/color][/b] [b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b] [b][color=RED])[/color][/b] Also I would advise to check that the creation of the circle was successful before deleting the point from the drawing. Just some constructive criticism Quote
Tharwat Posted November 25, 2010 Posted November 25, 2010 Hi Tharwat, Nice work I would be more inclined to use something like this to retain the layer/linetype/lineweight etc properties of the original points: Also I would advise to check that the creation of the circle was successful before deleting the point from the drawing. Just some constructive criticism Thank you Lee. But how to retain the layer/linetype/lineweight since that you did not use the (cdr (assoc 8 el)) to get that come true ? To check for the creation of Circles before deleting points that's really a very good idea . I like it. Your way of using the (apply 'append (subst .... within the entmakex is really shows a very deep understanding of codes. It's wonderful franckly. Tharwat Quote
Lee Mac Posted November 25, 2010 Posted November 25, 2010 But how to retain the layer/linetype/lineweight since that you did not use the (cdr (assoc 8 el)) to get that come true ? The code uses the values that are already present in the DXF data of the points - just replacing the necessary parts to make the DXF data into that which could represent a Circle. Your way of using the (apply 'append (subst .... within the entmakex is really shows a very deep understanding of codes. It's wonderful franckly. Thanks Tharwat, but I cannot take all the credit - the use of (subst nil ...) is a technique to remove a list item without using Visual LISP functions that I have seen used elsewhere in the past and so applied it to this situation - I might usually use vl-remove-if, or vl-remove Quote
Tharwat Posted November 25, 2010 Posted November 25, 2010 The code uses the values that are already present in the DXF data of the points - just replacing the necessary parts to make the DXF data into that which could represent a Circle. Suppose that the current layer is not the same Layer which points are laying on , so the created Circles would be created under the current Layer Name. Am I right ? Quote
Lee Mac Posted November 25, 2010 Posted November 25, 2010 Suppose that the current layer is not the same Layer which points are laying on , so the created Circles would be created under the current Layer Name. Am I right ? In your code: yes. In my code: no, the circle inherits the layer of the point. Quote
Tharwat Posted November 25, 2010 Posted November 25, 2010 Oh yeah , I guess that was due to the use of function *subst*. You are right . Thank you Quote
BIGAL Posted November 26, 2010 Posted November 26, 2010 If you have civ3d as you posted its a pain in the backside but you could create a point style that just matches a block etc but you can not explode them, our survey points have trees, valves, covers 100+ symbols etc it part of the point group properties to attach a block to a point. Why re-invent no dis-respect to the lisp programs provided. Quote
Lee Mac Posted November 26, 2010 Posted November 26, 2010 Why re-invent no dis-respect to the lisp programs provided. Definitely - in-built functionality should take priority over LISP in 99% of cases - else the user is demonstrating a lack of knowledge of the program (I know I have in the past...) 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.