Jump to content

Add different blocks based on the angle of the polyline or lwpolilinha.


Recommended Posts

Posted

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

Posted
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.

  • Like 1
Posted (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 by JuniorNogueira
Posted
4 hours ago, JuniorNogueira said:

lwpolilinha

Is this a Hawaiian polyline? 😂

  • Funny 2
Posted

@ronjonp I have a bad English, and this is how it is written in my country kkk  😂

Posted
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. 😉

  • Like 1
Posted
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. :facepalm: Lisp is partly written (1 & first part of 2) ,  tested and working.

  • Confused 1
Posted
36 minutes ago, dlanorh said:

 

Eu acho que o centavo caiu cerca de meia hora depois que eu respondi. : facepalm:Lisp é parcialmente escrito (1 e primeira parte de 2), testado e funcionando.

 

@dlanorh I did not understand :(
 

Posted
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

  • Thanks 1
Posted
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

  • Thanks 1
Posted

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

  • Thanks 1
Posted

Very very much Thank you @dlanorh
For an hour this will serve me well !!! you are the best!!!

  • Like 1
Posted
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.

  • Like 1
Posted
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?🤔

 

 

 

 

 

 

 

 

Posted
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.

 

  • Like 1
Posted

Attached is revised lisp to allow polyline selections via selection set.

 

 

plb2.lsp

  • Thanks 1
  • 7 months later...
Posted

Hello, how to replace block A to rotate in this position.
I have attached the .dwg example

 

Nv.thumb.PNG.fab2fc41e48f36281b1ec345f678db49.PNG

BAD.dwg

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...