Code Block - DS for Profile

Hello,
Hoping somebody could help me regarding DS in Code Blocks as my knowledge is very basic even though I have watch countless tutorials, but just can’t get my head around using DS it at the moment.
I have been given some basic profile points eg:

0,0
2140,0
2140,3660
1000,5200
-1000,5200
-2140,3660
-2140,0
0,0

With the profile looking like this in CAD

This profile needs to be applied to a path (points along a 3D polycurve) which I already have but was hope or if it is even possible to put this profile data into a code block (or could recommend a alternative method) which I can then apply to the path points. I have seen circles, regularpolygons and rectangles done but nothing of an odd profile as per above.

Many thanks in advance.

Dan

sweep.dyn (3.1 KB)

//Profile
x1={0,2140,2140,1000,-1000,-2140,-2140,0};
z1={0,0,3660,5200,5200,3660,0,0};
pnt1=Point.ByCoordinates(x1,0,z1);
prf1=Polygon.ByPoints(pnt1);

//Path
x2={-20000,-13000,0,14000,20000};
y2={-20000,-17000,0,5000,16000};
z2={13000,-5000,0,10000,0};
pnt2=Point.ByCoordinates(x2,y2,z2);
pth2=NurbsCurve.ByPoints(pnt2);

//Sweep
swp=Solid.BySweep(prf1,pth2);

You sir are a Legend!!, it make way more logical sense now.

1 Like