loop length in drawing

loop length in drawing

mathias.bergstrom
Contributor Contributor
4,884 Views
12 Replies
Message 1 of 13

loop length in drawing

mathias.bergstrom
Contributor
Contributor

Hello

 

I have spent som time on Google, tried to find this "annotation" in the drawing enviroment.

I use it in the sketch.

Now i want to show it on the drawing. How?

I use Inventor 2017 by the way.

 

Please help me out here. 🙂

 

 

 

0 Likes
Accepted solutions (2)
4,885 Views
12 Replies
Replies (12)
Message 2 of 13

Xun.Zhang
Alumni
Alumni

Hi Mathias,

 

Are you talking about loop length in Drawing sketch? if so, please go to tools -> Region properties and select the loop, calculate it.

you will get the value as perimeter.

 

Hope it helps!

 

Untitled.png


Xun
Message 3 of 13

mathias.bergstrom
Contributor
Contributor

Hi Xun,

 

Thanks for the quick answer!

But I want to show the loop length of a part in a drawing.

I got one part (.ipt) in one drawing (.dwg)

 

The part loop length of the part is confirmed in the sketch of the .ipt in the part enviroment.

Now I want to show the part loop dimension in the .dwg.

 

I have done a belt as a part around 3 pulleys in an assembly.

Now I put that belt-part on a drawing and I want to specify the length of it, to give to some suppliers to see if they have a belt who fit my pulley design.

Very simple. 

 

I'm not doing this for manufacture, just for info and discussion with a supplier of belts.

Then i have to arrange the location and size of the pulleys.

 

I just need this drawing with the loop length for translation  between CAD and the supplier.

0 Likes
Message 4 of 13

Xun.Zhang
Alumni
Alumni

Hi Mathias,

 

Is the loop information in part are a parameter in the parameter dialog? if so, please open parameter dialog, check ON export, then you can review it in the iProperty -> custom. Then, create a drawing, create a text and insert such parameter, you are all set.

 

If not, you have to manually add a user parameter and repeat the same steps above.

 

Hope it helps!


Xun
Message 5 of 13

mathias.bergstrom
Contributor
Contributor

Complicated...

 

In the sketch of the part there is an option to measure the loop length.

Also in the part you can measure a selected loop.

 

I just think it would be very nice to have the option to just click on the tool "loop length" in the drawind enviroment and get it done.

As the loop lenght isn't visible in the parameter dialog, its too timeconsuming and complicated for me to add it there.

 

Now i think the fastest way for me in this situation, is to do the measure in the sketch of the part, and do a manual annotation in the drawing.

When i manipulate the part i have to update manually the text in the drawing. Its not gonna read the property automatically from the part.

Boring...

 

Anyway, thanks for the help! 🙂

 

 

0 Likes
Message 6 of 13

Xun.Zhang
Alumni
Alumni

Hi Mathias,

 

How about create a 2D sketch in drawing based on a view and project the geometry you want, do the first method to get the region and copy, paste the value in the annotation?

 

Is it better?


Xun
Message 7 of 13

mathias.bergstrom
Contributor
Contributor

Thanks!

 

That is new info.

I will use that. But I still need to update the data on the drawing myself when manipulate the part.

 

 

0 Likes
Message 8 of 13

mathias.bergstrom
Contributor
Contributor

Hmm...

 

It looks like the Perimeter value i got from the projected view of the part in the drawing is affected from the scale.

The view scale has to be 1:1

Otherwise the Perimetervalue will be wrong.

 

I have to copy paste the looplength from the "Measure loop" tool in the part (.ipt) enviroment.

0 Likes
Message 9 of 13

johnsonshiue
Community Manager
Community Manager

Hi Mathias,

 

Could you capture the loop value in the part via iLogic or API and then store the value in an exported user parameter. It will be in Custom iProperties. Then you can leverage the iProperty or the user parameter in a drawing text.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 10 of 13

jletcher
Advisor
Advisor

Here is the ilogic code that will do what @johnsonshiue mention in his comment.

 

Just make a user parameter named Sweeplength and select export then you can recall it in the IDW.

 

Sweep.JPG

 

 

'Set a reference to the active part document
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument

Dim oDef As PartComponentDefinition
oDef = oDoc.ComponentDefinition

Dim opath As Path
opath = oDef.Features.SweepFeatures.Item("Sweep1").Path

Dim TotalLength As Double
TotalLength = 0

Dim oCurve As Object
Dim i As Integer

For i = 1 To opath.Count
oCurve = opath.Item(i).Curve

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 i

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

 

Also your sweep in the browser has to be named Sweep1 for code to work.

 

I would upload file but I already saved in 2018 format.

 

Message 12 of 13

kelly.young
Autodesk Support
Autodesk Support
Accepted solution

@S_May lots of good information and links in that post! Thanks for sharing, would have never found that so here is a consolidation of some of the good links:

 

Loop Length

Measure and evaluate the length of sweepings in Inventor

Show up-to-date loop length

 

Just a quick tip, there are many great links to other language forums that may look daunting.

 

If you are using Chrome, or another browser that has a translate feature, it makes it easy to follow along!

 

Translate.png

 

We have many multi-language experts so if you see an attached link that you can't read, translate it and you might find something great!

 

Please select the Accept as Solution button if a post solves your issue or answers your question.

Message 13 of 13

mathias.bergstrom
Contributor
Contributor

Thanks alot for all the information!

 

Very good info.

I'm not in to iLogic so much, but i will give it a shot.

You learn something new every day.