Update and save assembly through ilogic in Drawing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am new to Inventor and as a part of automating manufacturing drawings, am trying to include ilogic code in the drawing , that would accept values from the user and store it as "user parameters" and make corresponding changes in the inventor drawing file.
So, to replicate my issue on a smaller scale, i had created 2 parts and created an assembly out of these 2 parts. I used the assembly in my drawing.
In the Drawing i created a user parameter .. say "external_param". I am opening the drawing and changing the value of the user parameter through the (Fx) parameter table.
doc = ThisDoc.Document If external_param >= 50 And external_param <= 99 Then Parameter("block_1.ipt.d0") = 15 'change the length of the block Parameter("block_1.ipt.d14") = 3 'change the number of holes in the block ElseIf external_param >= 100 And external_param <= 199 Then Parameter("block_1.ipt.d0") = 40 Parameter("block_1.ipt.d14") = 5 ElseIf external_param >= 200 And external_param <= 299 Then Parameter("block_1.ipt.d0") = 80 Parameter("block_1.ipt.d14") = 6 ElseIf external_param >= 300 And external_param <= 399 Then Parameter("block_1.ipt.d0") = 160 Parameter("block_1.ipt.d14") = 9 End If RuleParametersOutput() iLogicVb.UpdateWhenDone = True 'InventorVb.DocumentUpdate()
As you can see, i have commented out InventorVb.DocumentUpdate() , im not quite sure what would accomplish the update and save of the assembly document in the background (without prompting for a save/update). I have also tried thisDoc.Save and thisdoc.update. Using these 2 commands along with the InventorVb.DocumentUpdate() or iLogicVb.UpdateWhenDone caused Inventor to Crash.
What am i missing? Could I get some assistance in the right direction . Thanks!
Vince