Move line

Move line

chan230984
Advocate Advocate
3,061 Views
38 Replies
Message 1 of 39

Move line

chan230984
Advocate
Advocate

Hi all. Please help me write lisp

I have a red line and a green line.
I want the green line Moved to the red line, With the green end of the line just attached to the red line

thanks

 

Untitled.png

0 Likes
Accepted solutions (3)
3,062 Views
38 Replies
Replies (38)
Message 2 of 39

pbejse
Mentor
Mentor

@chan230984 wrote:

Hi all. Please help me write lisp

I have a red line and a green line.


moved.jpg

Done

 

0 Likes
Message 3 of 39

Sea-Haven
Mentor
Mentor

What are the rules ? Washing my crystal ball at moment.

0 Likes
Message 4 of 39

Kent1Cooper
Consultant
Consultant

And what is the red "line?"  A Polyline?  Three independent Lines?

 

Manually, one way to do it is to Move the green Line so that its left end lies anywhere along the left red Line [or Polyline segment].  Then if the left red part is a Line, Copy it so that the temporary copy passes through the green Line's right end, and crosses the right red part.  Or if the red is a Polyline, draw a temporary Line over the left segment and Move that over to the green Line's right end.  Then Move the green line from its right end to the intersection of the right red part with the temporary Line.

 

That could perhaps be automated, but how to do so does depend on the answer to my first question.

Kent Cooper, AIA
0 Likes
Message 5 of 39

chan230984
Advocate
Advocate

@Kent1Cooper 

thank you, but I have to do it a lot

Red is the polyline

 

0 Likes
Message 6 of 39

chan230984
Advocate
Advocate

@Sea-Haven 

My purpose is to draw the road pipe work.

and I have to do it a lot

 

Untitled.png

0 Likes
Message 7 of 39

chan230984
Advocate
Advocate
0 Likes
Message 8 of 39

john.uhden
Mentor
Mentor

It appears that you want to move the line vertically so that its ends end up on the side slopes of your road.  But if the green line is a pipe, then either its length or slope will most likely have to change.  Anyway, I don't understand because your design should be controlled by elevation (level).  Moving the pipe to fit the side slopes makes no sense to me.  Instead you should copy the green line up a distance equal to the sum of pipe diameter and minimum height of headwall above pipe. Then the headwalls would be placed at the intersections of the copied line with the side slopes, and the pipe length modified to where the headwalls are, maintaining the pipe's slope.

John F. Uhden

0 Likes
Message 9 of 39

Kent1Cooper
Consultant
Consultant

I see the green Line is no longer there in the "after" part of your sample.  It should be possible to do this by picking the two points without  actually drawing a Line.

 

But your statement in Message 5 is not correct -- in both drawings the red is made up of three separate Lines.  That probably means it would be necessary to select the two points and their associated two Lines, in relation to each other [in other words, prompt the user to select the left point and the left Line, and then the right point and the right Line].  If that's an acceptable procedure, I think it could be automated without the need for the green Line.

Kent Cooper, AIA
0 Likes
Message 10 of 39

Kent1Cooper
Consultant
Consultant

@chan230984 wrote:

From this ...-move-block-help/m-p/7576464#M361947... I want to change from block to line.


That actually makes it easier than with the Block, because of the difficulty of having a routine find the corner of the Block if it's not at zero rotation, as described in Message 8 there.  [The Solution there may work if the Block is a rectangle, but I expect not necessarily if it has some other shape.]

Kent Cooper, AIA
0 Likes
Message 11 of 39

ronjonp
Mentor
Mentor

@chan230984 wrote:

Hi all. Please help me write lisp

I have a red line and a green line.
I want the green line Moved to the red line, With the green end of the line just attached to the red line

thanks


Explain your manual steps and maybe it can be translated to lisp.

Message 12 of 39

Sea-Haven
Mentor
Mentor

Something we did all the time adding to road cross sections so a bit more info to complicate matters. The end invert levels control and is it a pipe or a box culvert or is cutting permitted the Box culvert is 1.2m long a pipe is about 2.3m long and often are cut to suit. So it should be based around a cross section taking into account horizontal and vertical scales and the datum level of the section. Endwalls vary with the ultimate edge height being extended up so road edge does not wash away. Oh yeah we would normaly draw the pipe od & id so that varies also with plastic pipe being thinner.

 

A lisp would be good never got around to doing one, and happy to help, needs the following left and right offset from c/l same with invert levels, type of endwall. Use  lee-mac parse to get datum level ie "Datum 20.0" and in turn a Y value to work from, same with c/l pick for X. I have code for that.

 

0 Likes
Message 13 of 39

sby0531
Enthusiast
Enthusiast

Hi, I have developed a programme to move the green line sement to connect the two red line of road side slopes.  And the programme works well on my computer. The lisp file has been uploaded for your reference. One thing to be aware of, however, is that  a number of functions defined by myself have been called on this programme to simplify lisp programming. 

Message 14 of 39

pbejse
Mentor
Mentor

or

MoveLine.gif

0 Likes
Message 15 of 39

chan230984
Advocate
Advocate

@pbejse.

@sby0531 

HI

how to use

The program has an error.

1111111111.png

0 Likes
Message 16 of 39

pbejse
Mentor
Mentor

@chan230984 wrote:

@pbejseHI

how to use

The program has an error.


That should be directed to @sby0531  my friend 🙂 . The one i posted is istill is just a pipe dream and no chance of being developed in the real world.  😄

 

 

Message 17 of 39

chan230984
Advocate
Advocate

@pbejse 

you too

I was wrong.

0 Likes
Message 18 of 39

chan230984
Advocate
Advocate

Must thank everyone who helped me

I have to apologize to everyone. I'm not good at English

0 Likes
Message 19 of 39

sby0531
Enthusiast
Enthusiast

Hi, my friend.  Because quite a few functions defined by myself have been called in the command function that I updated, the command function cannot work untill all the related functions have been loaded. By the way, do you speak Chinese? 

0 Likes
Message 20 of 39

chan230984
Advocate
Advocate

@sby0531 

Hi, sorry i can not speak Chinese

Please attach a file as a video.

Thanks

0 Likes