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: 

Divide a segment equally with a range in visual basic

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
heyjude19
350 Views, 3 Replies

Divide a segment equally with a range in visual basic

How do you divide a segment equally with a range in visual basic?

 

example-

length is 144 in

range- 7.5 - 9in

answer- (18) at (range 8 in)

 

like to know how to do this in Visual Basic so I can create some rules and forms in iLogic

thx

3 REPLIES 3
Message 2 of 4
jonbrabbs
in reply to: heyjude19

Hi there,

 

There are loads of ways to do this. Here is one:

 

Sub Demo()
Dim Length As Double
Dim Range As Double

    Length = 144
    Range = 8

    MsgBox (Answer(Length, Range))
End Sub

Function Answer(L As Double, R As Double)
    Answer = L / R
End Function

This should be a start for you

 

Cheers

 

Jon.

///////////////////////////////////////////////////////////////////////////////////////////////////
If this post helps you, please give kudos.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Message 3 of 4
heyjude19
in reply to: jonbrabbs

Thanks Jon

- can this be done within the parameters instead of iLogic?

Message 4 of 4
jonbrabbs
in reply to: heyjude19

Yes, it's not difficult, but can be tricky and frustrating! Parameters can be pretty fickle when it comes to units.

 

If you have:

 

d0 = Length (in)

d1 = Range (in)

d2 = Answer/Segments (ul)

 

Note that the inch units cancel each other to give a unitless value (in/in = ul). 

 

Cheers

 

Jon.

 

 

///////////////////////////////////////////////////////////////////////////////////////////////////
If this post helps you, please give kudos.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

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

Post to forums  

Autodesk Design & Make Report