Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I am trying to simulate an Extrude to Face (in the assembly environment) of a sketch from "PartA" to a Face of "PartB". I have tried various object types derived from the selected face proxy but cant seem to get it right.
It fails on the extrusion creation.
Any pointers?
Dim oAssy As AssemblyDocument = oApp.ActiveDocument
Dim oPart As Inventor.PartDocument
Dim oPartOccurance As ComponentOccurrence
oPartOccurance = oApp.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Part")
If oPartOccurance Is Nothing Then
Exit Sub
End If
oPart = oPartOccurance.ReferencedDocumentDescriptor.ReferencedDocument
Dim oPartCompDef As PartComponentDefinition = oPart.ComponentDefinition
Dim oFaceProxy As FaceProxy = Nothing
oFaceProxy = oApp.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select Planar Termination Face")
If oFaceProxy Is Nothing Then
Exit Sub
End If
Dim oFace As Face
oFace = oFaceProxy.Geometry
Dim oSketch As Sketch = oPartCompDef.Sketches.Item("Sketch19")
Dim oProfile As Profile
oProfile = oSketch.Profiles.AddForSolid
Dim oExtrudeDef As ExtrudeDefinition
oExtrudeDef = oPartCompDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kJoinOperation)
oExtrudeDef.SetToExtent(oFace, True)
Dim oExtrude1 As ExtrudeFeature
oExtrude1 = oPartCompDef.Features.ExtrudeFeatures.Add(oExtrudeDef)
oAssy.Update2()
Solved! Go to Solution.