Draw Polyline based on another Polyline that follows object shape

Draw Polyline based on another Polyline that follows object shape

Anonymous
Not applicable
1,481 Views
7 Replies
Message 1 of 8

Draw Polyline based on another Polyline that follows object shape

Anonymous
Not applicable

I want to be able to select the red polyline and create a polyline that will connect the red one to the brown polyline (but parallel to the blue line), and then follow the brown polyline shape until the point A.

 

So the lisp should allows me to select the red polyline (or many of them), the blue polyline (to get the angle and draw the red line in parallel, until it gets in the brown line), the brown polyline (to get the points to follow) and the point A (to get the end point). What I actually need in the end is the length of this "route".

 

Could anyone help me? I'm a programmer, but starting with Lisp.

 

**Please zoom in to see the green line in the result images.

 

What I have:

1.PNG

What I want (result 1 > green line): 

2.PNG

What I want (result 2 > green line):

3.PNG

0 Likes
1,482 Views
7 Replies
Replies (7)
Message 2 of 8

cadffm
Consultant
Consultant

Again:

One hint: You should make more clear if you really need

the line parallel to the blue(cyan) one, or PERpendicular to brown..

 

See my sample, what is what you want in this case: The green or the yellow one?

And one question more: hat is you point A? Please share a dwg, much simpler then talk about pictures.

 

Unbenannt.JPG

green is parallel to the blue, yellow is just PER to the brown.

 

Sebastian

0 Likes
Message 3 of 8

Kent1Cooper
Consultant
Consultant

[I don't think it's at all unclear about the direction -- it says quite specifically parallel to the blue line, twice.]

 

Here's a question for you:  Would you ever have a situation similar to this?
PLintersectwith.PNG

One of the more likely ways to find the place on the brown Polyline where the green one should first meet it would be to draw a temporary Line and use (vla-intersectwith) methods to find where it intersects or its extension would intersect the brown Polyline.  That would typically include virtually extending the temporary Line, if not also the Polyline, because they may not actually intersect.  In that case, with a situation like the image, there would be more than one  intersection found [the dashed extension of the green].  Determining which is the right one would be a complication [though not impossible], but if such a situation would never occur, it's not worth accounting for.  But it could occur even when the middle leg of the brown is horizontal, if the direction based on the blue isn't.

 

Other questions arise....  Are arc  segments possible?  Is the brown one always drawn in the same direction?  More will probably come up if someone gets into trying to work something out.

Kent Cooper, AIA
0 Likes
Message 4 of 8

Anonymous
Not applicable

Hi. Thank you for your reply.

 

Regarding your question: yes, it can happen.

 

Adding one more image below (a bit more clear). The DWG example is attached.

 

Green: expected results (it's a cable in real life)

Brown: Polyline to be followed (it's a trench in real life)

Red: Polyline which starts (or ends) the polyline to be created (it's a cable in real life)

Blue: block which gives the reference to the first parallel segment, it was the blue line in the first example (it's a table of solar panels in real life)

Black: A polyline. Its intersection with the brown polyline represents the end point (it's a cable combiner box in real life).

 

4.PNG

0 Likes
Message 5 of 8

ara_neresesian
Collaborator
Collaborator

Hi 

what i am thinking is right?

for draw 2 green polyline

1-select red polyline for starting one from each end

2-select blue (block ) to find angle

3- select green line to find intersection from red to green by  blue angle

4-select white  line to find direction and end of 2 new green polylines.

if its right , i can tell you its possible to make autolisp for this processes.(but its hard challenge)

Good luck

 

0 Likes
Message 6 of 8

Anonymous
Not applicable

hi there!

 

what i am thinking is right?

for draw 2 green polyline

Yes! Draw two independent polylines 

 

1-select red polyline for starting one from each end

Correct

2-select blue (block ) to find angle

Correct, to create the first section of polyline parallel to the block until it "hits" the brown 

3- select green line to find intersection from red to green by  blue angle

Nop, actually the green lines are there just to show the two desired results. 

4-select white  line to find direction and end of 2 new green polylines.

yes, the white (or black in the example images) intersection with the brown line would be the end "point"

if its right , i can tell you its possible to make autolisp for this processes.(but its hard challenge)

Good luck

0 Likes
Message 7 of 8

cadffm
Consultant
Consultant

@Anonymous 

What's your first problem?

 

The biggest problem would be the panel block, i can't  think that you only works with this on block

and i guess the next panel block ist differently - i mean the direction of the panel objects inside..

Also the Block wasn't created in wcs, the content are 3dsolids, non planar, non parallel to the rest.

Thats the challange for you (and for helpers if present).

Except YOU are the programmer of this 'Block from hell' (01a66d91-01cf-43a4-8dc6-9d7b96a56be7_15_All).

 

I would start with a simpler version first: Create a simple rectang, maybe ortho to wcs X/Y.. create a block.

For this sample block you get the angle by property angle or DXF Code 50.

Sebastian

0 Likes
Message 8 of 8

ara_neresesian
Collaborator
Collaborator

HI

Please upload a few more and  different samples (  if possible dwg , if not  pictures) easy, hard, ,complicated ,and.... as more as better

i have to see all possibility to figuring algorithm.

Good luck 

0 Likes