Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a profile using 4 sketch lines. The sketch it produces is an enclosed figure. The error im getting is "Incorrect parameter when setting the profile object. Any ideas? Attached is the section of code. Its a copy of a working section of code where a centerpoint rectangle is used to create the sketch.
Dim partDef As PartComponentDefinition
partDef = oDoc.ComponentDefinition
' Create a new sketch.
Dim sketch As PlanarSketch
sketch = partDef.Sketches.Add(partDef.WorkPlanes.Item(3))
Dim oTG As TransientGeometry = oApp.TransientGeometry
Call sketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(-A, 0), oTG.CreatePoint2d(A, 0))
Call sketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(-A, 0), oTG.CreatePoint2d(-B, T))
Call sketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(A, 0), oTG.CreatePoint2d(B, T))
Call sketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(-B, T), oTG.CreatePoint2d(B, T))
Dim oProfile As Profile = sketch.Profiles.AddForSolid
Dim oExtrudeDef As ExtrudeDefinition = partDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kJoinOperation)
oExtrudeDef.SetDistanceExtent(z_length, PartFeatureExtentDirectionEnum.kNegativeExtentDirection)
Dim oExtrude As ExtrudeFeature = partDef.Features.ExtrudeFeatures.Add(oExtrudeDef)
Solved! Go to Solution.