Dim PartComponentDefinition = thisAppPartDocument.ComponentDefinition
Dim oSketch As PlanarSketch = PartComponentDefinition.Sketches.Add(PartComponentDefinition.WorkPlanes(2))
Dim pOrigin As SketchPoint = oSketch.AddByProjectingEntity(PartComponentDefinition.WorkPoints(1))
Dim oTransGeometry = App.TransientGeometry
oSketch.SketchCircles.AddByCenterRadius(pOrigin, 5)
Dim angle As Double = 90
Dim pElbowRevolveLine As SketchLine = oSketch.SketchLines.AddByTwoPoints(oTransGeometry.CreatePoint2d(-10, -20), oTransGeometry.CreatePoint2d(-10, 20))
Dim oNewWorkAxis As WorkAxis = PartComponentDefinition.WorkAxes.AddByTwoPoints(pElbowRevolveLine.StartSketchPoint, pElbowRevolveLine.EndSketchPoint, False)
Dim oProfile As Profile = oSketch.Profiles.AddForSolid()
Dim pElbowRevolve As RevolveFeature = PartComponentDefinition.Features.RevolveFeatures.AddByAngle(oProfile, oNewWorkAxis, angle, PartFeatureExtentDirectionEnum.kNegativeExtentDirection, PartFeatureOperationEnum.kJoinOperation)
This code is telling me the parameter is incorrect on the addbyangle method but I have no idea why or what is incorrect.
Solved! Go to Solution.
Solved by J_Pfeifer_. Go to Solution.
First thing to note, the angle input in Inventor is currently bugged. Create a variable to change your angle into a radian, then pass that new value into the equation. Your equation is: Value * math.pi / 180. Some people have had success using strings like: "360 deg".
The problem you're experiencing is more than likely not with the angle dimension. The bug currently inputs the angle at weird values. You'd enter 90 deg and get -9840 deg. However, the feature would still be created. I would look into the axis being created, making sure its oriented correctly to provide a revolve. Then I would investigate that profile. Make sure you have a profile active and that it does not overlap itself on the axis. It will fail if this is the case.
This actually was the problem! i converted my angle into radian and it started to work correctly for what i need it to do. thank you so much!
Can't find what you're looking for? Ask the community or share your knowledge.