Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Path for sweeping

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
278 Views, 0 Replies

Path for sweeping

Hi, I would like to make a sweeping using sketches already made in the file. There is no problem to define the profile, but i don't manage to create the path. The two sketches are planar and not in the same plane.

 

Where is the mistake ? Thanks you.

 

 

 

Public Sub Sweep()

    ' Set a reference to the currently active document.
    ' This assumes that it is a part document.
    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument

    ' Set a reference to the component definition.
    Dim oCompDef As PartComponentDefinition
    Set oCompDef = oPartDoc.ComponentDefinition

    ' Create a profile.
    Dim oSketch1 As PlanarSketch
    Set oSketch1 = oCompDef.Sketches.Item(1)

    Dim oProfile As Profile
    Set oProfile = oSketch1.Profiles.AddForSolid

    ' Create a path.
    Dim oSketch2 As PlanarSketch
    Set oSketch2 = oCompDef.Sketches.Item(2)
    
    Dim oPath As Path
    Set oPath = oCompDef.Features.CreatePath(oSketch2)

     'Create the sweep feature.
   Dim oSweep As SweepFeature
   Set oSweep = oCompDef.Features.SweepFeatures.AddUsingPath(oProfile, oPath, kJoinOperation)

End Sub

Tags (2)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report