- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Inventor 2022 API with Visual Studio
i try to make a Sweep Feature with using existing sketches, path and Profile.
This is my Code:
Imports System.Runtime.InteropServices
Imports Inventor
Imports Microsoft.Win32
Module CommandFunctionButton_08
Public Sub CommandFunctionfweButton_08()
Dim oPartDoc As PartDocument = g_inventorApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oTO As TransientObjects = g_inventorApplication.TransientObjects
Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry
Dim oSketchLine1 As Object
oSketchLine1 = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kSketchObjectFilter, "Select sketch line")
Dim oPathline As Path
oPathline = oCompDef.Features.CreatePath(oSketchLine1)
Dim oSectionSketch01 As Object
oSectionSketch01 = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kSketchObjectFilter, "Select sketch Section")
Dim oProfile As Profile
oProfile = oSectionSketch01.Profiles.AddForSolid
Dim oSweep As SweepFeature
oSweep = oCompDef.Features.SweepFeatures.AddUsingPath(oProfile, oPathline, PartFeatureOperationEnum.kJoinOperation)
End Sub
End Module
What is wrong?
Thanks for any Suggestion.
Solved! Go to Solution.