Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get the Loop lengt from Measure tool

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
RasmusBredal
554 Views, 2 Replies

Get the Loop lengt from Measure tool

Hey All 

 

I try to make a iLogic code that takes value from a loop, and adds this to a aarylist.

My problem is to get the value when I have selected a loop, with Measure tool. 

Some who can help me?

 

Dim app As Inventor.Application
app = ThisApplication
Dim LoopList As New ArrayList
'Set RUsure frist time 
RUsure = vbYes

While RUsure = vbYes
Dim oControlDef As ControlDefinition
oControlDef = app.CommandManager.ControlDefinitions.Item("AppMeasureLoopCmd") 
   
oControlDef.Execute2 (True)
'Add loop length top Arrylist
'Add the lengt from measure tool to LoopList

RUsure = MessageBox.Show("Will you ad more loop´s to custom iProperty", "Loop Length", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
	
	If RUsure = vbNo
	Exit While
	End If 
End While
	
'Get total loop lengt 
LoopValues = LoopList
sum = 0
For Each oval in LoopValues
sum += oval
Next

MsgBox(sum)
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: RasmusBredal

I do not have an example for it's usage but there is a method for MeasureTools.GetLoopLength check the VBA object browser or API documentation for more information.

 

Message 3 of 3
RasmusBredal
in reply to: Anonymous

Hey Ken

 

Thanks for the info about Measure Tools.GetLoopLength!

It works great! Smiley Happy

 

To pick the sketch path I found this:

https://forums.autodesk.com/t5/inventor-customization/loop-select-sketch-to-create-boundry/td-p/3170...

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

Post to forums  

Autodesk Design & Make Report