
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
I wanted to post this out there for people who may be running into crashing issues when adding occurances to an assembly or drawing views.
After struggling for several hours I noticed that if I stepped through the code, it wouldn't crash. And you may notice that Inventor will execute the next command before the previous has finished updating completely. As such, by adding this tid bit of code to "hold Inventor back" it allows the command to finish processing and continue without crashing.
Sub...
...
duration = 15
....
Call oCompdef.Occurances.Add(...)
Call HoldOnInv(duration)
....
end sub
Function HoldOnInv(duration)
Dim PauseTime, Start
PauseTime = duration ' in seconds
Start = Timer
Do While Timer < Start + PauseTime
DoEvents 'let's Inventor catch up
Loop
End Function
Hopefully this saves someone some headache! Night all!!
Solved! Go to Solution.