How much longer do we have to work out equations to simply get the loop length of a sweep into our parameters?
Does 2012 have this yet? I just want to pass the sweep length parameter to my partslist without buying addins, wrtiting code, or calculating volumes and areas etc.
Rob
2011 Pro
Solved! Go to Solution.
Solved by bobvdd. Go to Solution.
Rob,
I understand your disappointment. From what I can see, this particular request may sound simple but it can be tricky to implement. First, this dimension will have to be driven, not driving. Forcing a loop (of any combination of curves and lines) to be constrained can destablize a sketch. Or, it will have to be restricted to certain conditions that make the command very hard to use. Second, does the driven dimension need to be associative to the selected loop? If yes, the dimension will have to track the loop which can consist of n number of curves and lines. The loop selection set has to react to adding/removing loop participants. If not, Measure tool can provide the loop length already. Lastly, this new dimension command would have to behave quite differently from regular Inventor sketch dimension commands. It will behave more like a feature and it will put a reference parameter on the table as opposed to a model parameter.
These are all I can think of at this moment. There could be other implications I did not think of.
Thanks!
Hi Johnson,
Thanks for the response. I was thinking that Inventor already knows the curve length of the sweep and this could be then passed as a reference parameter that we could then use in our partslist. I understand what you are saying about the complications involved. Possibly we could get something one day.
Rob
Rob, i feel the same. I'd be quite happy if i could just dimension a loop as its measured by the tool as a ref dim then could link that parameter to something else. Not so worried about driving it, just using it elsewhere.
Dear Johnson,
You haven't convince me at all with your response, sorry. If the length of the loop is read and displayed with Measure tool, why that data can not be available as a driven parameter? The width and length of the flat pattern is although hidden from view, but at least there is a way to extract it. Why not the length of the loop?
Regards,
Igor.
I did ask for it 3 or 4 INV versions back. It was put on wish list - still nothing.
Another wish was to be able lock length of spline. Would be very helpful with flexible parts.
Hi! I am not trying to convince anybody here. My reply is purely based on my personal understanding how it might work (it could be wrong). You got a very good argument here in terms of Measure vs Driven. However, there is key differentiator between the two. For Measure, the measurement does not have to be associative, meaning the measurement is done at the time and the measured value does not need to stay associative to the loop length at all time. It is kind of like on demand. You measure it and Inventor returns the value of the total length of the loop. For driven dimension, the value will have to stay associative to the loop length at all time. The mechanism tracking the change and pointing to the loop will need to be in place. Or, it will not work.
Like I said, if unassociative dimension is OK, then Measure tool already provides the functionality.
Thanks!
Yes, I see your point with tracking individual loops. Maybe such an option as "Watch this loop/geometry" could be introduced to the Measure tool in the future. The way it would work is the length of "watched" geometry would get recorded and displayed in the parameters DB.
But as for me personally - I would have settled for simple ability to record the measurement taken in a text window. Similar to F2 (toggle to the text screen) in AutoCAD. Every time I need to compare readings "Before" and "After" - I have to manually write down the previous reading. It is not very convenient, really.
Regards,
Igor.
No Ray, it is not going to do. I guess, you take my wording literary. My mistake. I want to be able to see previous measurement and current measurement simultaneously. Without resolving to copying the info, pasting it to a text file and so on. I need a convenient method of comparing measuring results. Just like in AutoCAD.
Best Regards,
Igor.
@stevec781 wrote:Adding the ability to dimension the length of an arc in a sketch would be a good start.
I agree - at least I could use reference dimensions and then total them to a G_L parameter which I could pass to my partslist.
Rob
In attached part I used an iLogic rule to create a user parameter called "Sweeplength" that contains the length of a sweep.
The sweep feature that I am focusing on is called "TheSweep" (in case you have more than one sweep in your part).
As an example of use, you can change the sketch dimensions of the sweep path and the sweeplength parameter will automatically adjust. I used the parameter to change the thickness and overall dimensions of the part.
The iLogic rule can be used in other parts as long as you name the sweep that you are interested in "TheSweep" and as long as you trigger the rule on "partGeometryChange".
Enjoy.
Bob
Apologies Rob. Attached is a similar R2011 part.
In case someone wants to use the iLogic rule even in R2010, I included the code.
'Set a reference to the active part document Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oDef As PartComponentDefinition oDef = oDoc.ComponentDefinition ' Set a reference to the selected feature. Dim oSweep As SweepFeature oSweep = oDef.Features.SweepFeatures.Item("TheSweep") ' Get the centroid of the sweep profile in sketch space Dim oProfileOrigin As Point2d oProfileOrigin = oSweep.Profile.RegionProperties.Centroid ' Transform the centroid from sketch space to model space Dim oProfileOrigin3D As Point oProfileOrigin3D = oSweep.Profile.Parent.SketchToModelSpace(oProfileOrigin) ' Get the set of curves that represent the true path of the sweep Dim oCurves As ObjectsEnumerator oCurves = oDef.Features.SweepFeatures.GetTruePath(oSweep.Path, oProfileOrigin3D) Dim TotalLength As Double TotalLength = 0 Dim oCurve As Object For Each oCurve In oCurves Dim oCurveEval As CurveEvaluator oCurveEval = oCurve.Evaluator Dim MinParam As Double Dim MaxParam As Double Dim length As Double Call oCurveEval.GetParamExtents(MinParam, MaxParam) Call oCurveEval.GetLengthAtParam(MinParam, MaxParam, length) TotalLength = TotalLength + length Next Dim oparams As Parameters Dim oparam As Parameter oparams = oDoc.ComponentDefinition.Parameters Dim exists As Boolean exists = False 'Find out if parameter exists For Each oparam In oparams If oparam.Name = "Sweeplength" Then exists = True Next oparam 'Change the value if the parameter exists otherwise add the parameter If exists Then oparams.Item("Sweeplength").Value = TotalLength Else oparams.UserParameters.AddByValue ("Sweeplength", TotalLength, 11266) End If odoc.Update
Cheers
Bob
Dear All-
Good afternoon. I wish I could measure-and display-the actual length of a 2D curve of any kind-whether an arc or a parabola or even spline. Yes, it would be only a driven quantity. I am frustrated that inspect>measure can do this in the part and the sketch but not the drawing. I am doing something like making a pattern...still, this is a bit frustrating....can you put another vote in for this?
you can easily get/use arc lengths assuming you have 2013 or newer (maybe in 2012 but I cant check)
1. click once to create dimension on the arc
2. before clicking again to place the dimension, 'right click'
3. look in the 'dimension type' part of the menu that appears
edit: thats 'arc' in the circular sense only
Neil,
Here is a VBA macro that stores the length of any selected 2D equation curve (including parabola) in a custom parameter.
That custom parameter can be used to add the length to a drawing note. At least this way you don't have to retype the value on the drawing end.
Bob
Sub loop_length() 'Set a reference to the active part document Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument Dim oDef As PartComponentDefinition Set oDef = oDoc.ComponentDefinition Dim ocurve As SketchEquationCurve If (oDoc.SelectSet.count > 0) Then If (TypeOf oDoc.SelectSet.item(1) Is SketchEquationCurve) Then Set ocurve = oDoc.SelectSet.item(1) Else MsgBox ("Select a 2D equation curve first") Exit Sub End If Else MsgBox ("Select a 2D equation curve first") Exit Sub End If Dim TotalLength As Double TotalLength = ocurve.length Dim oparams As Parameters Dim oparam As Parameter Set oparams = oDoc.ComponentDefinition.Parameters Dim exists As Boolean exists = False 'Find out if parameter exists For Each oparam In oparams If oparam.Name = "CurveLength" Then exists = True Next oparam 'Change the value if the parameter exists otherwise add the parameter If exists Then oparams.item("CurveLength").Value = TotalLength Else Call oparams.UserParameters.AddByValue("CurveLength", TotalLength, 11266) End If oDoc.Update MsgBox ("Length is stored in custom parameter CurveLength") End Sub
check your post that i replied to, "whether an arc or a parabola or even spline."
@neil.hamilton wrote:
<snip>
But of course I AGREE with you that you CAN do this for ARCS...which is not what I asked about...
thanks bobvdd that looks like it will be handy