toberino Posted August 28, 2010 Posted August 28, 2010 Does anyone know of or can help me create a lisp that will copy or offset a block from a basepoint to a particular length following a polyline with arcs and lines? Quote
Tharwat Posted August 28, 2010 Posted August 28, 2010 Actually you can not make offset of a block, Copy command would do it instead. What do you mean by - following a polyline with arcs and lines ? Tharwat Quote
Tharwat Posted August 28, 2010 Posted August 28, 2010 Give this a try ..... (defun c:Cblk (/ sel ent basePT ) (if (setq sel (entsel "\nSelect a Block to copy :")) (if (= (cdr (assoc 0 (entget (car sel)))) "INSERT") (progn (setq ent (entget (car sel)) basePT (cdr(assoc 10 ent) ) ) (command "_.copy" sel "" basePT pause) ) (Alert "Only a Block must be selected") ) (alert "Nothing selected") ) (princ) ) Tharwat Quote
lpseifert Posted August 28, 2010 Posted August 28, 2010 Does anyone know of or can help me create a lisp that will copy or offset a block from a basepoint to a particular length following a polyline with arcs and lines? Investigate the use of the Measure and/or Divide command Quote
toberino Posted August 28, 2010 Author Posted August 28, 2010 Alright, I am going to describe what I mean with the help of some screenshots. This first shot is to show you the line I am dealing with. This second shot shows a total length of the line. I wil continue to edit this until I get what I need. Quote
Lee Mac Posted August 28, 2010 Posted August 28, 2010 Search for Alan's CopyAlongCurve.lsp It should do your bidding. Quote
toberino Posted August 28, 2010 Author Posted August 28, 2010 OK, I will go no further explaining my scenario. Alan's routine is exactly what I was looking for. Thank you Lee Mac. I am going to post the link to it so if anyone is searching for the same thing and come across this post they don't have to search for it. http://www.cadtutor.net/forum/showthread.php?46309-CopyAlongCurve.LSP-Divide-Measure-Dynamic&highlight=CopyAlongCurve.lsp Quote
toberino Posted August 31, 2010 Author Posted August 31, 2010 (edited) OK. I guess alan's routine is almost what I am looking for. The only thing it doesn't do correctly is keep the base point in dynamic mode. It copies it from the previous point. Are there any other lisp's that are like this that I can play with? When I copy it along the curve I need it to keep the original base point picked. I get a running line of measurements and every point is based off a "0" point. For example my first point is 131', my second point is 162', my third point is 198', and so on. All measurements are based off of a zero point. Edited August 31, 2010 by toberino Quote
toberino Posted August 31, 2010 Author Posted August 31, 2010 Give this a try ..... (defun c:Cblk (/ sel ent basePT ) (if (setq sel (entsel "\nSelect a Block to copy :")) (if (= (cdr (assoc 0 (entget (car sel)))) "INSERT") (progn (setq ent (entget (car sel)) basePT (cdr(assoc 10 ent) ) ) (command "_.copy" sel "" basePT pause) ) (Alert "Only a Block must be selected") ) (alert "Nothing selected") ) (princ) ) Tharwat I tried this one out to see what it did but it acts kind of funny. Can you explain to me what you use it for and how to best utilize it? Thanks. Quote
Tharwat Posted August 31, 2010 Posted August 31, 2010 Actually it is as fun as your question in the beginning . Quote
toberino Posted August 31, 2010 Author Posted August 31, 2010 Actually it is as fun as your question in the beginning . Post #8 explains what I am trying to accomplish. Quote
BlackBox Posted August 31, 2010 Posted August 31, 2010 Investigate the use of the Measure and/or Divide command How goes your investigation? Quote
toberino Posted August 31, 2010 Author Posted August 31, 2010 How goes your investigation? Investigating now...I thought I had my answer already but I was wrong. Quote
toberino Posted August 31, 2010 Author Posted August 31, 2010 Alright, it looks like the measure command places nodes or blocks on the entire length of the object spacing them apart the amount you choose. The divide command will place a node or block with equal spacing depending on how many equal parts I want. Are there more features involded in these commands that I am not aware of? Quote
BlackBox Posted August 31, 2010 Posted August 31, 2010 Alright, it looks like the measure command places nodes or blocks on the entire length of the object spacing them apart the amount you choose.The divide command will place a node or block with equal spacing depending on how many equal parts I want. Are there more features involded in these commands that I am not aware of? Great question. ... What has been your experience? ... What options have you used? ... When you tried these commands, did either of them do what you wanted? Quote
toberino Posted August 31, 2010 Author Posted August 31, 2010 Great question. ... What has been your experience? ... What options have you used? ... When you tried these commands, did either of them do what you wanted? I will play this game because I am a perfectionist. 1.) I have never used these commands. 2.) The options that are presented at the command line. 3.) No. Alan's lisp does do what I want but in order for it to work properly I have to start the lisp over for each point. When I am dealing with hundreds of points I need speed to be a factor. I need a slimmed down version only including the dynamic action and will copy from the original base point picked instead of going from the last point placed. Quote
lpseifert Posted August 31, 2010 Posted August 31, 2010 (edited) Why doesn't Measure work for you? Looks like you might have to try writing your own... hint... (vlax-curve-GetPointAt Dist...) Edited August 31, 2010 by lpseifert Quote
toberino Posted September 1, 2010 Author Posted September 1, 2010 Why doesn't Measure work for you? Looks like you might have to try writing your own... hint... (vlax-curve-GetPointAt Dist...) Measure does not work because it drops nodes at the spacing specified in the command following the entire length of the line or curve. My spacing is all different. So if my line is 9" long and I enter 2", it puts a node every 2" across the entire length of the line. My situation, hypothetically speaking, needs a node at 1.5", then 3.5", then 4", then 6.3", from the base point or zero point. All being measured from one direction. And yes, I believe you are correct. I think it's time for me to head to the tutorial section and learn how to write this lisp. I've been lucky enough to find the codes for everything else I have needed. Now I guess it's time to get my hands dirty. I have been looking forward to this....thanks lp for suggesting it. Quote
Lee Mac Posted September 4, 2010 Posted September 4, 2010 Hi Toberino, If you were still looking for a program like this, I have post something similar here: http://www.theswamp.org/index.php?topic=34792.0 Quote
BlackBox Posted September 4, 2010 Posted September 4, 2010 ... I think it's time for me to head to the tutorial section and learn how to write this lisp. I've been lucky enough to find the codes for everything else I have needed. Now I guess it's time to get my hands dirty. I have been looking forward to this... Great initiative! The determination doesn't hurt either! Happy coding...! 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.