i would like The output to be "One shape" instead of "Not one shape" basically i want to compare the 1st list(1st set) with the 2nd list (2nd set),2nd list (1st set) to 3rd list (2nd set ) and so on.
import dxfgrabber import math dwg = dxfgrabber.readfile("test.dxf") print("DXF version:{} ".format(dwg.dxfversion)) all_lines = [entity for entity in dwg.entities if entity.dxftype=='LINE'] for line in all_lines: start=line.start #for i in start: #print i print start print start[0] end=line.end #for n in end: #print n print end print end[0] if cmp(start,end)==0: print "One shape" else: print "Not one shape" #start_deff=end[0]-start[0] #end_deff=end[1]-start[1] #print math.sqrt(start_deff**2+end_deff**2)#
Output:DXF version:AC1024
(1.586566659262402, 8.156562005030274, 0.0)
1.58656665926
(3.041123276594333, 11.37341563410535, 0.0)
3.04112327659
Not one shape
(3.041123276594333, 11.37341563410535, 0.0)
3.04112327659
(7.550248640806287, 11.37341563410535, 0.0)
7.55024864081
Not one shape
(7.550248640806287, 11.37341563410535, 0.0)
7.55024864081
(7.550248640806287, 9.9829047026913, 0.0)
7.55024864081
Not one shape
(7.550248640806287, 9.9829047026913, 0.0)
7.55024864081
(8.277526949472247, 9.54707293644433, 0.0)
8.27752694947
Not one shape
(8.277526949472247, 9.54707293644433, 0.0)
8.27752694947
(1.586566659262402, 8.156562005030274, 0.0)
1.58656665926
Not one shape