Ilogic code for Sheet metal Lofted flange between 2 sketch

Ilogic code for Sheet metal Lofted flange between 2 sketch

ArunS2DHBM
Enthusiast Enthusiast
419 Views
2 Replies
Message 1 of 3

Ilogic code for Sheet metal Lofted flange between 2 sketch

ArunS2DHBM
Enthusiast
Enthusiast

Hi,

 

I required Ilogic code for a Sheet metal Lofted flange to create a loft between two given sketches.

0 Likes
420 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor

Here is sample in API help.

And here is short sample for your needs

Dim smCompDef As SheetMetalComponentDefinition = ThisDoc.Document.ComponentDefinition

Dim smFeatures As SheetMetalFeatures = smCompDef.Features

Dim sketch1 As PlanarSketch = smCompDef.Sketches(1)
Dim sketch2 As PlanarSketch = smCompDef.Sketches(2)

Dim profile1 As Path = smFeatures.CreatePath(sketch1.SketchLines(1))
Dim profile2 As Path = smFeatures.CreatePath(sketch2.SketchLines(1))

Dim loftedFlangeDefinition = smFeatures.LoftedFlangeFeatures.CreateLoftedFlangeDefinition(profile1, profile2)
smFeatures.LoftedFlangeFeatures.Add(loftedFlangeDefinition)

 

 

Message 3 of 3

ArunS2DHBM
Enthusiast
Enthusiast

Hi @Michael.Navara 

 

Thanks for the solution and its working, I require extra input, where I have total 4 sketches, 
2 at the bottom ( circle and rectangle), similarly at the top also.

 

I want the code to toggle between the different sketches and the loft should create. 

 

for a instance , BottomSketch=Circle, then in bottom it should take sketch1 and TopSketch=Rectangle, then it should take sketch3

other instance BottomSketch=Rectangle, then in bottom it should take sketch2 and TopSketch=Circle, then it should take sketch4

 

can u help with this, attached an image for your reference.

 

Thanks in advance

0 Likes