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: 

iLogic reference paramters

1 REPLY 1
Reply
Message 1 of 2
Jefkee
556 Views, 1 Reply

iLogic reference paramters

Hi,

 

I'm having some difficulties with iLogic and reference parameters.

 

I have made a tube with a weird shape and I want to measure the longest length. So I have to cut the tube in a certain angle in relation with the center to measure the length.

 

The problem is that this angle is really hard to calculate...

 

So I tried making a rule where I can make my angle shift x degree and then measure the longest length. If the measurement is larger the previous measurement the angle will shift x degree again until the measurement is smaller than the previous.

 

So I made my starting angle 0 degree, I know this is for a fact not the longest length. And then I tried this rule. (before making a While rule).

 

And I noticed that on screen the measurement changes. But the reference - paramter stays the same. So it gives me the measurement on the starting angle & after rotating it again gives me the starting angle.

 

How can I get the parameter to update itself in between? I tried some snippets as you see but no cheers..

 

 

Dim measurement_length As Double
Dim measurement_length2 As Double

MessageBox.Show("Start angle ", "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
angle_measurement_spec = 0


RuleParametersOutput()
InventorVb.DocumentUpdate()


measurement_length = Ref_meting_spec_hoek_plus
MessageBox.Show("measurement on starting angle: " & measurement_length, "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)


MessageBox.Show("rotate plane ", "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
angle_measurement_spec = angle_measurement_spec - 10


RuleParametersOutput()
InventorVb.DocumentUpdate()


measurement_length2 = Ref_meting_spec_hoek_plus
MessageBox.Show("measurement 2: " & measurement_length2, "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)

 

 

Thanks.

Inventor 2013
1 REPLY 1
Message 2 of 2
MegaJerk
in reply to: Jefkee

I would be interested to see the part you’re working with (though I couldn’t look at it until I got home as we only use 2012 here at work), but I do know that parameters typically get updated once a rule is finished running or in-between a rule change (which would happen if you ran a different rule from inside of the starting rule).

So, my suggestion would be, if you want to see the freshly updated parameters, write out a second rule – and then run that rule from inside of the starter rule. The problem with that method is that anytime you wanted to see the parameters new value, you’d have to have a new rule to switch over to, and that seems rather inappropriate.

Post the part file, or something that will help us recreate the part in question as someone may be able to help you in a more meaningful way.


If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub

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

Post to forums  

Autodesk Design & Make Report