- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How does one know if the FlipAlignmentAxis is positive or negative via code?
I am using C# but I can do the VB.Net conversion myself if needed.
Reason for needing to know this is when I do the FlatPatternOrientation changes, some files require the FlipAlignmentAxis set to true and some don't. I am guessing it is sometimes the axis is negative but should be positive etc. I will need to test on this data and set the FlipAlignmentAxis accordingly so every part being processed by my code generates the desired orientation. Everything is good in all the files tested except a handful seemed to orient upside down and if I manually process through the steps it is the FlipAlignmentAxis that is causing this issue. I currently set the FlipAlignmentAxis to "true" only, and for these few files it needs to be set to false because it is already correct.
I am guessing here that I want them all to be positive and a few are already set to positive by default and when I set the FlipAlignmentAxis to true it orients incorrectly (upside down). If it is not just finding neg or pos let me know what else I can key on to ensure my alignment is correct.
current code:
SheetMetalComponentDefinition ShtMtlCompDef = PRTDoc.ComponentDefinition as SheetMetalComponentDefinition;
FlatPatternOrientation FltPatOrient = ShtMtlCompDef.FlatPattern.FlatPatternOrientations.ActiveFlatPatternOrientation.Copy("Default");
.
<ShtMtlEdge is right most verticle edge on the A-SideFace>
.
FltPatOrient.Activate();
FltPatOrient.AlignmentAxis = ShtMtlCompDef.FlatPattern.GetFlatPatternEntity(ShtMtlEdge) as Edge;
FltPatOrient.AlignmentType = AlignmentTypeEnum.kVerticalAlignment;
FltPatOrient.FlipAlignmentAxis = true;
FltPatOrient.FlipBaseFace = true;
I believe I need to add a condition to only set FltPatOrient.FlipAlignmentAxis = true; (or to false) based on some information. I just don't know where to look for this information in the inventor sheet metal object model or how to handle if this should be applied or not via program only. It is easily enough noticeable when working with the part in person but not sure how to determine this via code only.
If anyone has any idea please help
Thank You
Shannon
Solved! Go to Solution.