general marko Posted March 18, 2015 Posted March 18, 2015 can someone help me with a lisp routine that inserts circles at every intersection of a polyline/series of line including its endpoint. thank you very much in advance. Quote
pBe Posted March 18, 2015 Posted March 18, 2015 What is the radius of the circle? Will that be ALL intersection and Endpoints of selected objects? Quote
Lee Mac Posted March 18, 2015 Posted March 18, 2015 These functions will get you most of the way there - you would just need to modify the example programs to generate circles as opposed to points. Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 ........ @pBe: A lisp routine sir that will ask for the diameter. @Lee Mac: The link was good sir but it's not just what i meant. Im going to post a picture, I can't really explain it. (sorry ) Thanks in advance my masters. The figure below is a polyline. Is it possible to have a lisp routine that will insert circles at each corner of the polygon (formed by a closed polyline) upon clicking it? Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 @pBe: A lisp routine sir that will ask for the diameter. @Lee Mac: The link was good sir but it's not just what i meant. Sorry, im not really good in explaining. I hope this explanation will do. A lisp routine that will insert circles at each corner (intersections and endpoints) of a polygon (formed by a closed polyline/or closed line) upon selecting that closed polyline/ or those lines. Thanks in advance my masters. Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 Thanks for the help and support mr Lee and mr pBe. But i think you don't get what i mean (sorry, im not good at explaining). I'll attach a picture so I can explain it further. thanks Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 The picture attached herewith is a closed polyline. The lisp routine that I need is that when you click that polyline/or closed polyline, it will insert circles at its intersections and endpoints. The diameter of the circle would depend on the user, so the routine will ask for its diameter/radius. Also if possible, it is applicable to lines. can you help me with this master Lee and master pBe? Thank you so much again. Quote
BIGAL Posted March 19, 2015 Posted March 19, 2015 (edited) Another way this code returns all the co-ords of a pline so you can then add your circle see last line in code. Code removed see next page for final version Edited March 20, 2015 by BIGAL Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 Okay mr BIGAL. I'll wait. Thanks again for helping me. Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 so this is the picture of what will the lisp routine will do. By selecting a closed polyline, the lisp will insert circles at its intersection including its end points. The user will define the diameter/radius of the circle. I also hope that this will be applicable to lines or series of lines. Thanks once again Quote
BIGAL Posted March 19, 2015 Posted March 19, 2015 (edited) Wow on line try this it is not tested no cad at moment ;original code by Jow Burke Autodesk forum (defun c:circonpline ( / Y ptlist nlist pt rad) (defun massoc (key alist / x nlist) (foreach x alist (if (eq key (car x)) (setq nlist (cons (cdr x) nlist)) ) ) (reverse nlist) ) ;end (setq ptlist (massoc 10 (entget(car(entsel "pick pline"))))) (setq rad (getreal "\nEnter radius")) (setq len (length ptlist)) (setq Y 0) (repeat len (setq pt (nth Y ptlist)) (Command "circle" pt Rad) (setq Y (+ Y 1)) ) ) (c:circonpline) Edited March 20, 2015 by BIGAL Quote
general marko Posted March 19, 2015 Author Posted March 19, 2015 Thanks mr BIGAL, but im confused, should I combine the first and second code you posted? Don't know the final code. sorry, just started learning. Quote
BIGAL Posted March 20, 2015 Posted March 20, 2015 Sorry just work from the 2nd code I will test shortly and make work found a much shorter way to do it. Quote
general marko Posted March 20, 2015 Author Posted March 20, 2015 thank you so much sir BIGAL, no need to say sorry. I'll just wait. Quote
BIGAL Posted March 20, 2015 Posted March 20, 2015 Thanks for waiting code above works, removed 1st code post Quote
general marko Posted March 20, 2015 Author Posted March 20, 2015 yah, thanks BIGAL, the code worked. But can I ask you one more favor, I want that the lisp will function after typing in the commandline the command "circonpline". The thing is, when I load this lisp routine, it will automatically run the lisp routine. Can you help me again with this? Thanks again sir BIGAL. Quote
general marko Posted March 20, 2015 Author Posted March 20, 2015 mr BIGAL, I've already edited the lisp for what I want. Luckily I got it. Thanks again for the code. regards marko Quote
BIGAL Posted March 21, 2015 Posted March 21, 2015 We do something similar but in one go over multiple plines, this can be added pretty easy so only need 1 run let me know or have a go yourself using SSGET 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.