## I want to find Line-Connection macro

Need help, or want to share a macro? Post here!
mrrclb48z
Posts: 27
Joined: Wed Feb 07, 2018 11:20 am

### I want to find Line-Connection macro

Line P0->P1->P2...->PN
Which of the 4 should be used? Please tell me the difference.
Partial Script:

Code: Select all

``````h=10
dx1=30*1
dx2=30*2
dx3=30*3
dx4=30*4
Connection1=[[dx1+0,0,h],  #0(1)
[dx1+h,0,h],  #1(2)
[dx1+h,h,h],  #2(3)
[dx1+0,h,h],  #3(4)
[dx1+0,0,0],  #4(5)
[dx1+h,0,0],  #5(6)
[dx1+h,h,0],  #6(7)
[dx1+0,h,0]]  #7(8)
Connection2=[(dx2+0,0,h),  #0(1)
(dx2+h,0,h),  #1(2)
(dx2+h,h,h),  #2(3)
(dx2+0,h,h),  #3(4)
(dx2+0,0,0),  #4(5)
(dx2+h,0,0),  #5(6)
(dx2+h,h,0),  #6(7)
(dx2+0,h,0)]  #7(8)
Connection3=([dx3+0,0,h],  #0(1)
[dx3+h,0,h],  #1(2)
[dx3+h,h,h],  #2(3)
[dx3+0,h,h],  #3(4)
[dx3+0,0,0],  #4(5)
[dx3+h,0,0],  #5(6)
[dx3+h,h,0],  #6(7)
[dx3+0,h,0])  #7(8)
Connection4=((dx4+0,0,h),  #0(1)
(dx4+h,0,h),  #1(2)
(dx4+h,h,h),  #2(3)
(dx4+0,h,h),  #3(4)
(dx4+0,0,0),  #4(5)
(dx4+h,0,0),  #5(6)
(dx4+h,h,0),  #6(7)
(dx4+0,h,0))  #7(8)
print(Connection1)
print(Connection2)
print(Connection3)
print(Connection4)
#[[30, 0, 10], [40, 0, 10], [40, 10, 10], [30, 10, 10], [30, 0, 0], [40, 0, 0], [40, 10, 0], [30, 10, 0]]
#[(60, 0, 10), (70, 0, 10), (70, 10, 10), (60, 10, 10), (60, 0, 0), (70, 0, 0), (70, 10, 0), (60, 10, 0)]
#([90, 0, 10], [100, 0, 10], [100, 10, 10], [90, 10, 10], [90, 0, 0], [100, 0, 0], [100, 10, 0], [90, 10, 0])
#((120, 0, 10), (130, 0, 10), (130, 10, 10), (120, 10, 10), (120, 0, 0), (130, 0, 0), (130, 10, 0), (120, 10, 0))
``````
(Sample) MacroRecording
full Script:

Code: Select all

``````import FreeCAD
import DraftTools
import Draft
Draft.makeWire(points,closed=False,face=True,support=None)
Draft.makeWire(points,closed=False,face=True,support=None)