Those shifty planes! Need advice on approach.

Those shifty planes! Need advice on approach.

llorden4
Collaborator Collaborator
425 Views
4 Replies
Message 1 of 5

Those shifty planes! Need advice on approach.

llorden4
Collaborator
Collaborator

I've run into issue where it appears where my approach to create a new plane is getting derailed based upon other design options within the model that seem to be affecting the behavior of the plane constraints.

llorden4_0-1621605928553.png

In this part I making varying end feature configurations on either side of the part, there will be different sizes, shapes, and orientations.  The feature currently giving me grief is this highlighted plane on my left I use to create the edge chamfer.  It's created by an angle to and edge from a plane.  The XZ plane provides a stable reference plane and the edge is a centerline axis of the hole; pretty stable features to work with and you can see here I am achieving my desired goal.

[My code for creating these work features]

oTmp = oCompDef.WorkAxes.AddByAnalyticEdge(oEdges.Item(1))
 oTmp.Name = "Sec Hole Axis"
oTmp = oCompDef.WorkPlanes.AddByLinePlaneAndAngle(oCompDef.WorkAxes.Item("Sec Hole Axis"), oCompDef.WorkPlanes.Item("XZ Plane"), oWorkAngle / 2 * PI / 180 * Orient, False)
 oTmp.Name = "Sec Chamfer Plane"

 When I started to develop the coding for my next feature option, I noticed that the plane feature rotated unexpectedly, and I thoroughly went through my code looking for possible conflicts but haven't been able to identify any.  I've had plenty of experience with planes rotating unexpectedly in Inventor, so I'm thinking this is simply an issue with my approach to the problem.

llorden4_1-1621606752477.png

As soon as I select a different feature for the opposite side, my created plane rotates its orientation.  Am I wrong for thinking this is unstable and unpredictable?  My plane has no constraints to the other features, why would it's behavior change when I'm using stable base features?  Is there a more reliable approach to creating planes that you can suggest?

 

@johnsonshiue Or is this likely a bug that needs addressing?   I know some will ask to see the code/model, but the code is already well over 1000 lines of code and that's a lot to ask of anyone short of the most curious.   Let's focus on the approach for now and discuss whether or not this is a good development path.

 

Using Inventor 2021.3

 

Autodesk Inventor Certified Professional
0 Likes
426 Views
4 Replies
Replies (4)
Message 2 of 5

oransen
Collaborator
Collaborator

Just a suggestion...does it all work correctly when you do it all by hand, manually?

0 Likes
Message 3 of 5

llorden4
Collaborator
Collaborator

Yes, the manual approach works fine, and I missed your suggestion.

Autodesk Inventor Certified Professional
0 Likes
Message 4 of 5

oransen
Collaborator
Collaborator
Ah, my suggestion was to try it by hand, it may have given some clue.... 😞
Message 5 of 5

llorden4
Collaborator
Collaborator

Finding my work-around reveals that the plane appears to Flip.Normal for some reason.  Adding the option to Flip.Normal to the code resulted in a number of different errors (probably down stream  effects within my code since the error changed as I REM'd out various code to test).  My chosen solution to avoid searching for all these other issues was to simply add an algorithm that simulated the flip.normal without causing any ripple effects.

 

oTmp = oCompDef.WorkAxes.AddByAnalyticEdge(oEdges.Item(1))
 oTmp.Name = "Sec Hole Axis"
 oTmp.Visible = False
If PShape = "Nose" Then
	oTmp = oCompDef.WorkPlanes.AddByLinePlaneAndAngle(oCompDef.WorkAxes.Item("Sec Hole Axis"), oCompDef.WorkPlanes.Item("XZ Plane"), oWorkAngle / 2 * PI / 180 * Orient, False)
Else 'wtf?  Plane flips.normal if primary side is not also a nose feature??????!!!!!!!
	oTmp = oCompDef.WorkPlanes.AddByLinePlaneAndAngle(oCompDef.WorkAxes.Item("Sec Hole Axis"), oCompDef.WorkPlanes.Item("XZ Plane"), ((oWorkAngle / 2) + 180) * PI / 180 * -Orient, False)
End If
 oTmp.Name = "Sec Chamfer Plane"
 oTmp.Visible = False

 The Orient variable is simply a value of 1 or -1 to control the polarity value for my Y axis formula's.  I get that it's quite possible I developed the original in the inverted position but it should at least be constant in the inverted position if I did.

 

This will become quite annoying if I have to develop a series of condition statements for each type of feature combination that I have to develop.

Autodesk Inventor Certified Professional
0 Likes