JuniorNogueira Posted October 17, 2018 Posted October 17, 2018 Add different blocks based on the angle of the polyline or lwpolilinha. Hello people, I have some cases and I do not know if it is possible to altoma them with a .lsp, these are my cases: 1. st Block * B * must be inserted in all verticies of my Polylines or LWpoliline. 2. If the angle is straight or up to a maximum of 174 beyond block B, block D will also be added. 3. At the beginning and end of my Polylines or LWpoliline Block A will be added. also at angles greater than 174 However 2 blocks should be added. I'm going to attach a .dwg file to help with the result, as expected. Thank you in advance for your help. SP.dwg Quote
dlanorh Posted October 17, 2018 Posted October 17, 2018 3 hours ago, JuniorNogueira said: 2. If the angle is straight or up to a maximum of 174 beyond block B, block D will also be added. 3. At the beginning and end of my Polylines or LWpoliline Block A will be added. also at angles greater than 174 However 2 blocks should be added. I sort of understand 2. but could do with a slightly better explanation of the highlighted red items. 1 Quote
JuniorNogueira Posted October 17, 2018 Author Posted October 17, 2018 (edited) @dlanorh Thanks for your replay. In my current file file I show with an example a simpler way of understanding. 2. Block B must be inserted when the angles are straight or with a minimum difference (up to 174 °). 3. At the beginning and at the end, block A will be added. When there is a greater angle (174 °), 2 blocks will be added as in the example. Edited October 17, 2018 by JuniorNogueira Quote
ronjonp Posted October 17, 2018 Posted October 17, 2018 4 hours ago, JuniorNogueira said: lwpolilinha Is this a Hawaiian polyline? 2 Quote
JuniorNogueira Posted October 17, 2018 Author Posted October 17, 2018 @ronjonp I have a bad English, and this is how it is written in my country kkk Quote
ronjonp Posted October 17, 2018 Posted October 17, 2018 9 minutes ago, JuniorNogueira said: @ronjonp I have a bad English, and this is how it is written in my country kkk No worries .. I'm sure your Portuguese is better than mine. 1 Quote
dlanorh Posted October 17, 2018 Posted October 17, 2018 26 minutes ago, JuniorNogueira said: @dlanorh Thanks for your replay. In my current file file I show with an example a simpler way of understanding. 2. Block B must be inserted when the angles are straight or with a minimum difference (up to 174 °). 3. At the beginning and at the end, block A will be added. When there is a greater angle (174 °), 2 blocks will be added as in the example. I think the penny dropped about half an hour after I replied. Lisp is partly written (1 & first part of 2) , tested and working. 1 Quote
JuniorNogueira Posted October 17, 2018 Author Posted October 17, 2018 36 minutes ago, dlanorh said: Eu acho que o centavo caiu cerca de meia hora depois que eu respondi. Lisp é parcialmente escrito (1 e primeira parte de 2), testado e funcionando. @dlanorh I did not understand Quote
dlanorh Posted October 17, 2018 Posted October 17, 2018 1 hour ago, JuniorNogueira said: @dlanorh I did not understand 2 hours ago, JuniorNogueira said: Eu acho que o centavo caiu cerca de meia hora depois que eu respondi Sorry. re "The penny dropped.." is a local english way of saying that i realised what you meant at a later time. 2 hours ago, JuniorNogueira said: Lisp é parcialmente escrito (1 e primeira parte de 2), testado e funcionando. I am half way through writing the lisp 7 hours ago, JuniorNogueira said: 1. st Block * B * must be inserted in all verticies of my Polylines or LWpoliline. 2. If the angle is straight or up to a maximum of 174 beyond block B, block D will also be added. 3. At the beginning and end of my Polylines or LWpoliline Block A will be added. also at angles greater than 174 However 2 blocks should be added. 1. Is finished and working 2 & 3 are half finished as i am still working on the condition statement for the angles 1 Quote
dlanorh Posted October 17, 2018 Posted October 17, 2018 4 hours ago, JuniorNogueira said: @dlanorh Thanks for your replay. In my current file file I show with an example a simpler way of understanding. 2. Block B must be inserted when the angles are straight or with a minimum difference (up to 174 °). 3. At the beginning and at the end, block A will be added. When there is a greater angle (174 °), 2 blocks will be added as in the example. Can you look at the attached dwg and answer the mleadered questions (?) question.dwg 1 Quote
JuniorNogueira Posted October 17, 2018 Author Posted October 17, 2018 @dlanorh Exactly!! see .dwg with the expected result. questionRP.dwg Quote
dlanorh Posted October 18, 2018 Posted October 18, 2018 OK. Attached is documented Lisp. This works as I expect it to, but you have the final say. Still not sure I am getting the correct block at intermediate vertices. Any problems let me know. plb.lsp 1 Quote
JuniorNogueira Posted October 18, 2018 Author Posted October 18, 2018 Very very much Thank you @dlanorh For an hour this will serve me well !!! you are the best!!! 1 Quote
dlanorh Posted October 18, 2018 Posted October 18, 2018 7 hours ago, JuniorNogueira said: Very very much Thank you @dlanorh @JuniorNogueira You're welcome. Please check that it works correctly for all cases. It can be easily adapted to use a selection set if required. 1 Quote
JuniorNogueira Posted October 19, 2018 Author Posted October 19, 2018 2 hours ago, dlanorh said: @JuniorNogueira You're welcome. Please check that it works correctly for all cases. It can be easily adapted to use a selection set if required. Yes @dlanorh It works very very well !!! It was fantastic !! A selection set would be great !! is it possible to apply a different condition if you see a parallel polyline? Quote
dlanorh Posted October 19, 2018 Posted October 19, 2018 4 hours ago, JuniorNogueira said: A selection set would be great !! is it possible to apply a different condition if you see a parallel polyline? I'll sort the selection set. Re the parallel polyline, send me a drawing showing the condition and i'll let you know. 1 Quote
dlanorh Posted October 19, 2018 Posted October 19, 2018 Attached is revised lisp to allow polyline selections via selection set. plb2.lsp 1 Quote
JuniorNogueira Posted June 14, 2019 Author Posted June 14, 2019 Hello, how to replace block A to rotate in this position. I have attached the .dwg example BAD.dwg 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.