Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loop Length

27 REPLIES 27
SOLVED
Reply
Message 1 of 28
RobJV
7328 Views, 27 Replies

Loop Length

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

27 REPLIES 27
Message 2 of 28
johnsonshiue
in reply to: RobJV

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!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 28
RobJV
in reply to: johnsonshiue

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

Message 4 of 28
CadUser46
in reply to: RobJV

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.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 5 of 28
IgorMir
in reply to: johnsonshiue

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.

Web: www.meqc.com.au
Message 6 of 28
2grumpy
in reply to: IgorMir

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. 

Message 7 of 28
johnsonshiue
in reply to: IgorMir

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!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 8 of 28
IgorMir
in reply to: johnsonshiue

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.

Web: www.meqc.com.au
Message 9 of 28
Ray_Feiler
in reply to: IgorMir

Loop.JPG


Product Design & Manufacturing Collection 2024
Sometimes you just need a good old reboot.
Message 10 of 28
IgorMir
in reply to: Ray_Feiler

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.

Web: www.meqc.com.au
Message 11 of 28
stevec781
in reply to: IgorMir

Adding the ability to dimension the length of an arc in a sketch would be a good start.

Message 12 of 28
RobJV
in reply to: stevec781


@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

Message 13 of 28
bobvdd
in reply to: RobJV

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

 




Bob Van der Donck


Principal UX designer DMG group
Message 14 of 28
RobJV
in reply to: bobvdd

Any chance I could I see this in Inv 2011?

Message 15 of 28
bobvdd
in reply to: RobJV

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 




Bob Van der Donck


Principal UX designer DMG group
Message 16 of 28
neil.hamilton
in reply to: bobvdd

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?

"If wishes were horses,
we'd all be eating steak!"
Message 17 of 28
CAG_DRAFT
in reply to: neil.hamilton

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

Message 18 of 28
neil.hamilton
in reply to: CAG_DRAFT

I agree, that's a great feature if you only have circular arcs.
However, I do not. I have parabolas generated by the equation curve function.
Why can I do "measure" in the model on sketch
but NOT in the drawing-where I need it most?
Granted, Inventor may take the position "sheetmetal should be able to do this"....
But why should there be no overlap in capabilities? It was stated AutoCAD can do this...maybe you Inventor company folks should have a little talk with the AutoCAD folks and straighten this situation out...I am sure there are "other priorities"...but part of the whole attracitveness of CAD is you can use higher math-or you can click a button and exploit all the expensive features of this CAD package-that cannnot do what I need it to do in this particular situation.....anybody-can ProE or SolidWorks or CATIA do this? Maybe its too hard for anybody..,. basically I need to make a pattern from a finished assembly....like a shoemaker or dressmaker...
But of course I AGREE with you that you CAN do this for ARCS...which is not what I asked about...
"If wishes were horses,
we'd all be eating steak!"
Message 19 of 28
bobvdd
in reply to: neil.hamilton

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

 




Bob Van der Donck


Principal UX designer DMG group
Message 20 of 28
CAG_DRAFT
in reply to: neil.hamilton


@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...

check your post that i replied to, "whether an arc or a parabola or even spline."
thanks bobvdd that looks like it will be handy
 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report