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 doesn't run at once

3 REPLIES 3
Reply
Message 1 of 4
roy-rohana
317 Views, 3 Replies

iLogic doesn't run at once

At work, I create very huge assemblies and all the related product drawings. I have some knowledge and skills in iLogic, and I look forward to incorporate iLogic functionality in the whole process. I started creating the first sketch for the one of the assemblies - tank assembly. I need to control the location of the top of the tank above or below the origin depending on whether the elevation is positive or negative. The iLogic I created produce what I need - but not right away. I have to run the iLogic again and again to get the result. I spent a lot of time without success. Pl. help.
3 REPLIES 3
Message 2 of 4
Jefkee
in reply to: roy-rohana

Did you add event triggers to the rule? Or do you have a rule what does run where you can add at the end: run.rule("xxxx")?

Inventor 2013
Message 3 of 4
roy-rohana
in reply to: Jefkee

Thanks for trying to help me. Currently, no iTrigger used. I run it from the iLogic itself. ElevPN = RelativeElevation MessageBox.Show("Elevation: " & ElevPN, "Title") Dim oSketch As Sketch 'Dim oSketch As PlanarSketch Dim oDims As DimensionConstraints Dim oDim As DimensionConstraint oSketch = ThisDoc.Document.ComponentDefinition.Sketches.Item("Sketch1") oDims = oSketch.DimensionConstraints For Each oDim In oDims If oDim.Parameter.Name = "Elev_Up" Then oDim.Driven = True MessageBox.Show("Message Elev_Up: " & "Driven", "Title") Exit For End If Next For Each oDim In oDims If oDim.Parameter.Name = "Elev_Down" Then oDim.Driven = True MessageBox.Show("Message Elev_Down: " & "Driven", "Title") Exit For End If Next If ElevPN >= 0 Then MessageBox.Show("Message2-1: " & "Elevation - Positive", "Title") For Each oDim In oDims If oDim.Parameter.Name = "Elev_Up" Then oDim.Driven = False MessageBox.Show("Message Elev_Up: " & "Drive", "Title") Elev_Up = 0 Exit For End If Next End If InventorVb.DocumentUpdate() If ElevPN < 0 Then MessageBox.Show("Message2-2: " & "Elevation - Negative", "Title") For Each oDim In oDims If oDim.Parameter.Name = "Elev_Down" Then oDim.Driven = False MessageBox.Show("Message Elev_Down: " & "Drive", "Title") Elev_Down = 0 Exit For End If Next End If iLogicVb.UpdateWhenDone = True
Message 4 of 4
prasanthr
in reply to: roy-rohana

Try to run your rule through ilogic..

auto = iLogicVb.Automation
iLogicVb.RunRule("Rule1")

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

Post to forums  

Autodesk Design & Make Report