Having an Issue with revolving using the AddByAngle method.

Having an Issue with revolving using the AddByAngle method.

andrew_smith3MSBWJ
Participant Participant
227 Views
2 Replies
Message 1 of 3

Having an Issue with revolving using the AddByAngle method.

andrew_smith3MSBWJ
Participant
Participant

 

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.

0 Likes
Accepted solutions (1)
228 Views
2 Replies
Replies (2)
Message 2 of 3

J_Pfeifer_
Advocate
Advocate
Accepted 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. 

 

0 Likes
Message 3 of 3

andrew_smith3MSBWJ
Participant
Participant

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!