Creating a loft surface based on a 3D Sketches

eikTSYFE
Participant
Participant

Creating a loft surface based on a 3D Sketches

eikTSYFE
Participant
Participant

Dear Community,

I am trying to automate the steps to create a geometry in Inventor 2024.

I have a couple of open 3D splines (each of them in a 3D sketch). Now I want to generate a surface by using the "loft" command. No guiding rails are involved, just the splines as sections. Doing this manually works fine (see my screenshot), but my iLogic code fails.

 

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oComp As PartComponentDefinition
oComp = oDoc.ComponentDefinition
Dim oSections As ObjectCollection
oSections = ThisApplication.TransientObjects.CreateObjectCollection

' Started with this example in (2D):
' oSections.Add(oComp.Sketeches("XY").Profiles.AddForSurface)
' But "AddForSurface" doesn't seem to be available for Profiles3D. "AddOpen"
' might not be the right one...

oSections.Add(oComp.Sketches3D("L1").Profiles3D.AddOpen)
oSections.Add(oComp.Sketches3D("L2").Profiles3D.AddOpen)
oSections.Add(oComp.Sketches3D("L3").Profiles3D.AddOpen)
oSections.Add(oComp.Sketches3D("L4").Profiles3D.AddOpen)

Dim oDef As LoftDefinition
oDef = oComp.Features.LoftFeatures.CreateLoftDefinition(oSections, kJoinOperation)

Dim oLoft As LoftFeature
oLoft = oComp.Features.LoftFeatures.Add(oDef)

 

Any help is appreciated - thank you!

Eike

0 Likes
Reply
Accepted solutions (1)
325 Views
2 Replies
Replies (2)

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @eikTSYFE . I changed line 19 (kSurfaceOperation), created a Surface. Did you want it?

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oComp As PartComponentDefinition
oComp = oDoc.ComponentDefinition
Dim oSections As ObjectCollection
oSections = ThisApplication.TransientObjects.CreateObjectCollection

' Started with this example in (2D):
' oSections.Add(oComp.Sketeches("XY").Profiles.AddForSurface)
' But "AddForSurface" doesn't seem to be available for Profiles3D. "AddOpen"
' might not be the right one...

oSections.Add(oComp.Sketches3D("L1").Profiles3D.AddOpen)
oSections.Add(oComp.Sketches3D("L2").Profiles3D.AddOpen)
oSections.Add(oComp.Sketches3D("L3").Profiles3D.AddOpen)
oSections.Add(oComp.Sketches3D("L4").Profiles3D.AddOpen)

Dim oDef As LoftDefinition
oDef = oComp.Features.LoftFeatures.CreateLoftDefinition(oSections, kSurfaceOperation)

Dim oLoft As LoftFeature
oLoft = oComp.Features.LoftFeatures.Add(oDef)

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes

eikTSYFE
Participant
Participant

Thank you so much!

That is exactly, what I wanted to achieve... Didn't really found any comprehensive documentation. Where could I have gotten this information from?

Eike

0 Likes