Duplicate polylines which is not have same start point

Duplicate polylines which is not have same start point

Anonymous
Not applicable
1,312 Views
6 Replies
Message 1 of 7

Duplicate polylines which is not have same start point

Anonymous
Not applicable

Check which plotline is duplicate and it's vertex is not in same sequence

0 Likes
Accepted solutions (1)
1,313 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant

Not enough information.

 

Does "duplicate" mean just the same shape, or also at the same location ?  Are you looking for something to find  such duplicates without User input, or would you select  some Polylines that look the same and you want something to figure out which [if any] starts in a different place than the others?  I assume you mean more than two  duplicates, because if there are only two, they are both duplicates of each other, and if they start at different places, how could something decide which one is the "right" one and which one is "wrong"?  Are two that are the same shape but rotated at different angles  duplicates?  Etc., etc.

 

Post a sample drawing with the kinds of duplicates you mean, what steps you want the User to take, and how you want the result to be indicated.

Kent Cooper, AIA
0 Likes
Message 3 of 7

Anonymous
Not applicable

There is same shape and vetex also but it is different direction or start or end point is different. There is no any user input. And may be there is more than two polylines. I am trying to used mapcar function for two list. If vertex a b c d of one polyline and second polyline start with b c d and end with a

0 Likes
Message 4 of 7

dbhunia
Advisor
Advisor

Hi Dipak

 

By using the below code you will get a list of all the points of a polygon (Starting from Start to End in sequence)

 

(defun Poly_Cor_Extr (key cor / val cor_list)
(foreach val cor
(if (eq key (car val)) (setq cor_list (cons (cdr val) cor_list)))
)
(reverse cor_list)
)

 

Using syntex...

 

(Setq selectionset (ssget))
(setq Data (ssname selectionset 0));; Here "0" for the first selection
(setq lst (Poly_Cor_Extr 10 (entget Data)));;The "lst" will give you the co-ordinates list.

 

Now you iterate through your selection set as your requirement.......

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 5 of 7

Anonymous
Not applicable

attached dwg file

0 Likes
Message 6 of 7

dbhunia
Advisor
Advisor
Accepted solution

Hi,

 

If you use my code.....you will get the list of co-ordinates like.....

 

For white polyline-

((622456.0 984851.0) (623050.0 985348.0) (623525.0 984878.0) (623316.0 984350.0)
(622977.0 984353.0) (622826.0 984172.0) (622615.0 984245.0) (622371.0 984495.0))

Here start point(Blue) End point(Red).... both are same due to closed polygon but the sequence of the other vertex are as per polygon start-end.

 

For Blue polyline-

((623525.0 984878.0) (623316.0 984350.0) (622977.0 984353.0) (622826.0 984172.0)
(622615.0 984245.0) (622371.0 984495.0) (622456.0 984851.0) (623050.0 985348.0))

Here start point(Blue) End point(Red).... both are same due to closed polygon but the sequence of the other vertex are as per polygon start-end.

 

By using this code you will get same vertex values because both polygon are same except the Draw sequence.....i.e. start to end......

 

Now you decide what do you want?............Actually requirement is not clear to me.....

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 7 of 7

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... There is no any user input. ....


 

If that means that you want a routine to find  those kinds of duplicates for you without User selection, it may be possible, but in a drawing of any complexity it may be very difficult.  I imagine it would need to find every  Polyline in the drawing, and compare every one  of them to every other one  of them, which could be a huge number of comparisons.  Can you narrow it down in some way, by asking the User to specify [for example] a Layer that possible duplicates will be on?

 

Be aware that such lists containing the same vertices, but vertices only, do not guarantee that the Polylines are duplicates -- one could contain arc segments, or both could but in different places, one could be closed but not the other, there could be width differences, etc., etc.

 

A routine could at least avoid digging out lists of vertices from every Polyline for comparison, by starting the comparison between any two of them with a check on whether they have the same number of vertices and the same area and are both either open or closed.  If they match up that far, then it could get the vertices.  Exactly how it would decide whether they're duplicates is something of a challenge, but may be possible.

Kent Cooper, AIA
0 Likes