spline and helix length to parameter

spline and helix length to parameter

cadman777
Advisor Advisor
989 Views
11 Replies
Message 1 of 12

spline and helix length to parameter

cadman777
Advisor
Advisor

Hi all...

Does anyone know how to automatically get the length of a spline and helix segment and attach it to a Parameter so if the geometry changes the Parameter updates?

I'd be grateful for any input on this.

 

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
990 Views
11 Replies
Replies (11)
Message 2 of 12

Gabriel_Watson
Mentor
Mentor
Accepted solution
Probably should post this in the iLogic forum. I think you can measure the length of the feature then save it as a parameter later.

Similar threads:
https://forums.autodesk.com/t5/inventor-forum/how-to-use-ilogic-to-measure-length-of-edge/td-p/10542...
And here:
https://www.cadforum.cz/en/ilogic-rule-to-measure-loop-length-in-a-sketch-tip8910
0 Likes
Message 3 of 12

cadman777
Advisor
Advisor

Thanx for that info. Unfortunately I had already went down that pathway and found no solution. I was hoping Sergio's iLogic code would work, but I kept getting an error that I could not figure out. The other caveat is, I want to measure the geometry not the feature. Do you know if that is possible?

 

Incidentally, the Measure tool works just fine, so there must be a way to do it using iLogic or VBA, right?

 

The way I envision doing it is to first identify the sketch and then the geometric entity by type that's inside that sketch. Then solicit the measure command and apply it to that entity. Then input that value into a UserParameter. Done.

 

But maybe I'll be forced to make the feature a sweep and measure that?

Thanx for the links, they may lead to something else that works.

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 4 of 12

blandb
Mentor
Mentor
Accepted solution

Does this sound like something you are looking for?

 

https://www.youtube.com/watch?v=2mpzme_GGBA 

Autodesk Certified Professional
0 Likes
Message 5 of 12

johnsonshiue
Community Manager
Community Manager
Accepted solution

Hi Chris,

 

Maybe this thread could help.

 

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/measure-the-length-of-3d-sketch-heli...

 

Many thanks!

 



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

cadman777
Advisor
Advisor

@Gabriel_Watson: Thanx for your help! Unfortunately none of those worked (IV2010).

@blandb: Before coming in here I stumbled across Mark's blog. Unfortunately, all the pics and code were missing on the blog (broken links). However, the video was very informative. So I took the time to manually type-in the code and test it. Unfortunately it didn't work. Bummer! Anyway, thanx for your input!

@johnsonshiue: Thanx for that link! It just goes to show how bad my memory is these days! I asked this question back in 2019, and discovered that it was impossible to do in IV2010. So I'm repeating what I did back then: manually measuring the curve and manually inputting it into the Parameter. That's the only manual work I have to do on this project, so I'm OK with it.

Cheers!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 7 of 12

johnsonshiue
Community Manager
Community Manager

Hi Chris,

 

You are more than welcome! When I found the thread, I thought you might have seen it. I just wanted to share it with other users. My memory also suffers occasional corruption. The Covid isolation did not help.

I wish you could upgrade to more recent releases. Your request can be fulfilled by an iLogic rule relatively easily.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 8 of 12

cadman777
Advisor
Advisor

I hear ya. I too wish I could upgrade. Unfortunately, I can't afford it. Besides, I don't believe in slavery.

 

Based on the world politics that I know, software subscription is a white collar version of slavery and extortion (as I've said in other threads). The fact that everyone has grown accustomed to that kind of criminal activity and accepts it without a peep is something I can't comprehend. Where are all the MEN today?

 

Software subscription is basically the legitimization of the corporate mafia. Sad the world we live in today. There's a verse in the Bible that says when Jesus returns to rule the planet, all the rich will serve him (12:1, p114). That's quite a change, considering how today the 'idle rich' are screwing everyone in the world through their fiat money based monopoly capitalism and their monopoly on labor through corporate social structure. Unfortunately for them, they will pay for their evil deeds on Judgment Day.

 

Thanx again for your constant excellent input!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 9 of 12

cadman777
Advisor
Advisor
Accepted solution

I guess it's time to go back to basics...as usual!

Here's how I did it for the HELIX.

I guess the developers wanted us to do our own math.

I constructed the Helix using Revs & Height, but you can do it with Pitch & Height as well.

Took a little doing, b/c first I had to make Parameters for height of 1 full Rev and # of Revs in the total height.

The rest was easy.

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 10 of 12

b.mccarthy
Collaborator
Collaborator

Ladies & Gents...

 

I opened the unmodified Helix_Length-01.ipt and checked the G_L_Helix parameter:

2023-01-21 610.jpg

 

I checked this against the result from the Measure tool.:

2023-01-21 611.jpg

 

Except for the precision setting, these seem to match. Notice the metric value.

 

I then ran the unmodified 3D loop length rule as defined in @Gabriel_Watson's post above (Message 2):

https://www.cadforum.cz/en/ilogic-rule-to-measure-loop-length-in-a-sketch-tip8910 and this displays:

2023-01-21 612.jpg

 

Not sure why this is different. Can anyone verify this?

 

Thank you.

0 Likes
Message 11 of 12

johnsonshiue
Community Manager
Community Manager

Hi! The cadforum's iLogic rule is for measuring 3D lines, not for 3D splines or helical curves. Here is a simple rule I found to show the helical curve length in mm. There is still minor discrepancy between the shown value and the measured result.

 

Dim oDoc As PartDocument = ThisDoc.Document
Dim Sketch As Sketch3D
Sketch = oDoc.ComponentDefinition.Sketches3D(1)
Dim SE As SketchFixedSplines3D
SE = Sketch.SketchFixedSplines3D
MsgBox(SE.Item(1).Length*10)

 

I need to work with the project team to understand it better.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 12 of 12

MjDeck
Autodesk
Autodesk
Accepted solution

Hi Johnson, 
 The Length value from the SketchFixedSpline3D object is close, but it is not as accurate as what you get from the Measure command.
You can use the MeasureTools API to get a more accurate number:

 

Dim oDoc As PartDocument = ThisDoc.Document
Dim sketch1 As Sketch3D
sketch1 = oDoc.ComponentDefinition.Sketches3D(1)
Dim splines3d As SketchFixedSplines3D
splines3d = sketch1.SketchFixedSplines3D
Dim lengthInInches As Double
lengthInInches = ThisApplication.MeasureTools.GetLoopLength(splines3d.Item(1)) / 2.54
MessageBox.Show("Length in inches = " & lengthInInches, "Measure Length")

 


Mike Deck
Software Developer
Autodesk, Inc.