Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Dear,
I have a part, I want to create project geometry on edges and offset the edges to 1 inch and extrude the sketch. Please refer to the attached image A and B. I want to create image B.
I used the below codes, but could not complete the code. Please help.
Sub Main
Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition oCompDef = oPartDoc.ComponentDefinition Dim oSketches As PlanarSketches = ThisApplication.ActiveEditDocument.ComponentDefinition.Sketches Dim oSketch1 As PlanarSketch oSketch1 = oSketches("Sketch1") 'I have used the existing sketch to extrude
Dim oProfile As Profile oProfile = oSketch1.Profiles.AddForSolid ' Create a base extrusion 1 inch thick. Dim oExtrudeDef As ExtrudeDefinition oExtrudeDef = oCompDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kJoinOperation) Call oExtrudeDef.SetDistanceExtent(1, kNegativeExtentDirection) Dim oExtrude As ExtrudeFeature oExtrude = oCompDef.Features.ExtrudeFeatures.Add(oExtrudeDef) Dim oFrontFace As Face oFrontFace = oExtrude.StartFaces.Item(1)
'Code not working from here Dim oSketch2 As PlanarSketch oSketch2 = oCompDef.Sketches.Add(oFrontFace) Dim featEdge As Edge For Each featEdge In oFrontFace.Edges Call oSketch2.AddByProjectingEntity(featEdge) Next
end sub
Solved! Go to Solution.