Twullf
Mechanical
- Jan 24, 2012
- 196
I am trying to use the following callout to place an angular dimension:
Sometimes in the data the slope of the line, goes from positive to negative. As UG doesn't like negative dimensions we add 360 to all of the angles. Manually this works fine, by the program moves from using the positive direction of the Y axis to the negative and completely changes the slope direction. Is there a way to force the program to always use the positive direction on the Y axis and the endpoint of the created line, regardless of whether it is the minor or major angle?
Code:
Dim strTwist = "360+S" & counter & "_Twist"
Dim dimObject1_3 As Sketch.DimensionGeometry
dimObject1_3.Geometry = lineChord
dimObject1_3.AssocType = Sketch.AssocType.EndPoint
dimObject1_3.AssocValue = 0
dimObject1_3.HelpPoint.X = 0.0
dimObject1_3.HelpPoint.Y = 0.0
dimObject1_3.HelpPoint.Z = 0.0
dimObject1_3.View = workPart.ModelingViews.WorkView
Dim dimObject2_3 As Sketch.DimensionGeometry
Dim datumAxis1 As DatumAxis = CType( workPart.Datums.FindObject( "SKETCH(5:1B) Y axis" ), DatumAxis )
dimObject2_3.Geometry = datumAxis1
dimObject2_3.AssocType = Sketch.AssocType.EndPoint
dimObject2_3.AssocValue = 0
Dim HelpPoint As Point3d = Transform.Apply( New Point3d( -90, 74, 0 ) )
dimObject2_3.HelpPoint.X = HelpPoint.x
dimObject2_3.HelpPoint.Y = HelpPoint.y
dimObject2_3.HelpPoint.Z = HelpPoint.z
Dim nullNXObject As NXObject = Nothing
dimObject2_3.View = nullNXObject
Dim dimOrigin3 As Point3d = Transform.Apply( New Point3d( 1500, 3, 0 ) )
Dim sketchDimensionalConstraint3 As SketchDimensionalConstraint
sketchDimensionalConstraint3 = theSession.ActiveSketch.CreateDimension( Sketch.ConstraintType.MinorAngularDim, _
dimObject1_3, dimObject2_3, dimOrigin1, nullExpression, Sketch.DimensionOption.CreateAsDriving )
Sometimes in the data the slope of the line, goes from positive to negative. As UG doesn't like negative dimensions we add 360 to all of the angles. Manually this works fine, by the program moves from using the positive direction of the Y axis to the negative and completely changes the slope direction. Is there a way to force the program to always use the positive direction on the Y axis and the endpoint of the created line, regardless of whether it is the minor or major angle?