Place iFeature and Setting the Rotation

Place iFeature and Setting the Rotation

dsouva
Enthusiast Enthusiast
321 Views
1 Reply
Message 1 of 2

Place iFeature and Setting the Rotation

dsouva
Enthusiast
Enthusiast

I'm working with a 3rd party to develop a program in VB.NET that places an iFeature. If the user enters a negative X or Y value, we want the feature rotated by 270 degrees. On one part, it rotates it by 90 degrees. On another part, it rotates it by 180 degrees. I don't understand why it's different between two parts when the code is exactly the same for setting the value of the rotate parameter. 

 

 

If dXValue < 0 Or dYValue < 0 Then
    Try
        Dim dTempX, dTempY As Double
        dTempX = dXValue
        dTempY = dYValue
        dXValue = dTempY
        dYValue = dTempX
        Dim oFPoint As Inventor.Point
        oFPoint = oPoint.Point
        Dim oFAxis As Vector
        oFAxis = oTG.CreateVector(0, 0, 1)
        oPlaneInput.SetPosition(oFPoint, oFAxis, (0))
        oPlaneInput.SetPosition(oFPoint, oFAxis, (270 * Math.PI / 180))
    Catch ex As Exception
    End Try
End If

 

 

iFeature Dialog 02.pngiFeature Dialog 01.png

0 Likes
322 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @dsouva.  Inserting custom iFeatures by code can certainly be challenging at times.  What types of geometry selections are being made before that step?  Are you aware that objects like Face & WorkPlane have a 'direction'?  And things like Edge & WorkAxis also have a direction.  You usually do not see their direction until you do something like manually creating constraints between them, and after you select one, you will usually see a temporary arrow associated with that geometry that is pointing a certain direction, and that can be used to determine whether the constraint should be a Mate or a Flush type (aligned or opposed).  That underlying direction will usually play a role in these types of situations.  And sometimes even a mirrored body may look exactly the same as the original, but some of its faces and/or edges may have opposite directions.  And since angle measurements usually reference a pivot point, and a positive angle goes counter-clockwise, I believe that angle direction is in reference to looking straight at the pivot axis, while it is pointing straight at your eyes.  If the pivot axis was pointing away from your eyes, the positive rotation would appear to be going the other direction around the pivot axis.  Just some thoughts.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes