Hey there gang!
I have a part with a curve in it. I want to tabulate CoG position vs the degree of curve which is controlled by a dimension.
Is there a quick way to set this up so i'm not manually changning the dimension and recording the CoG every time?
Thank you.
Joe Banger
Joe, I wrote an iLogic rule a while back that calculated the volume of an odd shaped product, and wrote the volumes to a text file. I thought that your problem is simular to the volume rule, so i rewrote that rule to this:
Dim MaxCurveDegree = 90 Dim MinCurveDegree = 10
If CurveDegree >= MaxCurveDegree Then MessageBox.Show("CurveDegree is maximal", "Title") Else CurveDegree = MinCurveDegree ' Start at MinCurveDegree
While CurveDegree <= MaxCurveDegree -1 CurveDegree = CurveDegree + 1 RuleParametersOutput() InventorVb.DocumentUpdate(False) iLogicVb.UpdateWhenDone = True 'Save the paramters to a textfile Dim oAppend As System.IO.StreamWriter oFile = ThisDoc.PathAndFileName(False) & ".txt" oAppend = IO.File.AppendText(oFile) oAppend.WriteLine("CurveDegree: " & CurveDegree &" - " & "Center of Gravity: " & iProperties.CenterOfGravity) oAppend.Flush() oAppend.Close() End While End If
The CurveDegree is your controlled dimension, i added the MaxCurveDegree and MinCurveDegree to set it's limits.
I changed this rule from memory, so it's not tested. But maybe it helps you.
Rob.