Need lisp for direction change of polyline

Need lisp for direction change of polyline

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

Need lisp for direction change of polyline

Anonymous
Not applicable

Hi every one can you help me to come out from this. I need lisp for change direction of polyline with the reference of source with unique identity number.

I am having inputs and outputs in the form of polylines with unique identity number(both are having same identity number)and polyline segments are same in both input and output but those polylines directions are mismatching between input and output i need to change all output polylines direction with the reference of input polylines ASAP.

 

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

Anonymous
Not applicable

Hello @Anonymous
it would be much simpler if you could send a .dwg explaining better.

 

 

 

 

0 Likes
Message 3 of 8

CodeDing
Advisor
Advisor

@Anonymous,

 

It sounds like you are describing the REVERSE command. If you know the input / output then pass the polyline to this function..

 

Something like this..?

 

(defun RPL ( ent / )
;;ReversePolyLine ;;Not tested (command "_.REVERSE" (car ent) "") (princ) );defun

 

Best,

~DD

 

0 Likes
Message 4 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... inputs and outputs ....


That wording is what I wonder about.  What is the nature of an "input" and an "output"?  If what you mean is, for example, that you have a Polyline, and you output its vertices to some kind of external file, and then you pull them from that external file to draw a new Polyline (a copy of the original), it could be that the method used to get the original's vertices (there are various ways to do it) results in their being in reverse order.  Or possibly it's the other way around, that the code that brings them back in somehow works from the wrong end of the source information.  Such a cause should be easily fixable, if you have the code that does the output and input operations.

 

If that's not the issue, tell us more about the process of outputting and inputting, the format of the information involved, etc.

Kent Cooper, AIA
0 Likes
Message 5 of 8

Anonymous
Not applicable

Hi Júnior Nogueira,

Currently i am unable to share original .dwg but i am giving you Screenshots which is similar to original drawing. In input every segment having one id like 12345, 12346 & 12347 which is similar or replica to output need to modify polylines direction similar to input polylines.InputInputoutputoutput

0 Likes
Message 6 of 8

Anonymous
Not applicable

But some cases in output some polylines directions are irrespective to input we have to change that polyline directions similar to input polyline direction

0 Likes
Message 7 of 8

Anonymous
Not applicable

I am giving you Screenshots which is similar to original drawing. In input every segment having one id like 12345, 12346 & 12347 which is similar or replica to output. Need to modify polylines direction similar to input, some cases in output some polylines directions are irrespective to input we have to change that polyline directions similar to input. polyline direction.input polyline segmentsinput polyline segmentsoutput polyline segmentsoutput polyline segments

0 Likes
Message 8 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... i am giving you Screenshots which is similar to original drawing. In input every segment having one id like 12345, 12346 & 12347 which is similar or replica to output need to modify polylines direction similar to input polylines.


Those images don't really tell us very much.  Is each line in those grids a single-line-segment Polyline, or do they have segments within them?  What is the nature of the "id" of every segment -- extended data, perhaps?  And again, what is the process of output and input, and the format of the information?

 

If you want things to be replicas, running in the same direction, how about just using COPY?

Kent Cooper, AIA