iLogic code isn't update until exit the code

iLogic code isn't update until exit the code

Anonymous
Not applicable
516 Views
3 Replies
Message 1 of 4

iLogic code isn't update until exit the code

Anonymous
Not applicable

I want to create a helix with a variable numbers of item and then shown. I want to illustrate a flow, with a "moving arrow".  the parameter "no" is number of arrows.

the code is: 

 

Dim i As Integer
For i = 1 To 40
	Tid1 = now()
	Dim Tid2 As Date = Tid1.AddSeconds(0.25)
	Do Until Tid1 >= Tid2
	Tid1 = Now()
	Loop
no = i ' number of items in rectangular pattern

	InventorVb.DocumentUpdate
	iLogicVb.UpdateWhenDone = True
	Parameter.UpdateAfterChange = True

	Next i

model is not updates before exit the code, I want to show first 1 arrow, then 2 arrows, 3 arrows, ect.
I want to update the model before the code is exited. want to animate with variable number of arrowswant to animate with variable number of arrowspic2.jpg
0 Likes
517 Views
3 Replies
Replies (3)
Message 2 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Hoping that below iLogic code would help to animate.

Dim i As Integer
For i = 1 To 40
	Threading.Thread.Sleep(3000) 'Delays 3 secs to create next arrow
no = i ' number of items in rectangular pattern InventorVb.DocumentUpdate iLogicVb.UpdateWhenDone = True Parameter.UpdateAfterChange = True Next i

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 4

Anonymous
Not applicable

thanks for your reply, a better code for delay, but still my part file is first updated when all the code is finish. So there is still no animation, only the final result. FYI my pattern pic3.jpg

0 Likes
Message 4 of 4

MechMachineMan
Advisor
Advisor

1. You are literally telling it to ONLY update after the code is finished by using the line "UpdateWhenDone".....

 

2. Parameters can get out of sync with the model. If you use the Parameter("d0") format, you can use extra lines to make things happen smoothly..

 

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2015...

 

 

'iLogicVb.UpdateWhenDone = True
MultiValue.UpdateAfterChange = True 'likely not needed if you aren't using multivalue...
Parameter.UpdateAfterChange = True
RuleParametersOutput()

Dim i As Integer
For i = 1 To 40
Tid1 = now()
Dim Tid2 As Date = Tid1.AddSeconds(0.25)

Do Until Tid1 >= Tid2
Tid1 = Now()
Loop

InventorVb.DocumentUpdate
no = i ' number of items in rectangular pattern
Next i

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes