Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having an Issue with revolving using the AddByAngle method.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
andrew_smith3
51 Views, 2 Replies

Having an Issue with revolving using the AddByAngle method.

 

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.

2 REPLIES 2
Message 2 of 3
J_Pfeifer_
in reply to: andrew_smith3

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. 

 

Message 3 of 3
andrew_smith3
in reply to: J_Pfeifer_

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.

Post to forums  

Autodesk Design & Make Report