Activating Model States - Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey
I have an assembly with 30 model states (qty can change depending on design)
The assembly has a single base component that also has 30 model states.
The base component has 6 bodies to represent a part
The body in the base component is driven by a surface sketch perimeter
Each Model State share the exact same everything with the exception of 1 change which is a column number. So if i change the column number, the position of the body moves to the next position.
If my start height is 100in and my end height is 130in, each model state will change by 1in in height.
My objective is to show these assemblies in a top level assembly.
There is a condition on the perimeter to check of the top & bottom faces are parallel. If they are, i pattern 1 occurrence 30 times, if they are not, i need 30 independent assemblies (hence the model states)
There are plenty of ways to do this, all providing good / bad results. Here is what i have tried
Adding Component with model state using iLogic
This was ok but time consuming. It took about 8 minutes to add 30 assembly occurrences with different model states and ground / root them using code.
Dim TempOccName As String = "NewPanel:" & i
Dim OccName As String = "PANEL TYP " & i
'ADD THE PANEL WITH A TEMP OCCURRENCE NAME (WEIRD AUTODESK REQ.)
Dim NewPanelAssy = Components.AddWithModelState(TempOccName, "GLAZING.iam", OccName)
'GET THE OCCURRENCE OF THE NEW COMPONENT
Dim NewPanelOcc As ComponentOccurrence = oAssyDef.Occurrences.ItemByName(TempOccName)
'GROUND & ROOT THE NEW COMPONENT
NewPanelOcc.Transformation = ThisApplication.TransientGeometry.CreateMatrix
NewPanelOcc.Grounded = True
'REMOVE THE TEMP NAME TO REVEAL THE TRUE OCCURRENCE NAME
NewPanelOcc.Name = ""
making the pattern elements independent
I thought this would be quicker seeing as the assemblies were already in the top level assembly but its not.
Dim oPattern As OccurrencePattern = oDef.OccurrencePatterns.Item("PANEL TYP PATTERN")
For i As Integer = 1 To oPattern.OccurrencePatternElements.Count
Select Case i
Case 1
Case Else
oPattern.OccurrencePatternElements.Item(i).Suppressed = False
oPattern.OccurrencePatternElements.Item(i).Occurrences(1).ActiveModelState = "PANEL TYP " & i + 1
Dim oOccName As String = oPattern.OccurrencePatternElements.Item(i).Occurrences(1).Name
oPattern.OccurrencePatternElements.Item(i).Independent = True
Dim oOcc As ComponentOccurrence = oDef.Occurrences.ItemByName(oOccName)
oOcc.Transformation = ThisApplication.TransientGeometry.CreateMatrix
oOcc.Grounded = True
End Select
Next
If i do this manually without code, i can complete the task in 8 mins, 40 seconds ( i timed it). With code, 19 mins 25 seconds...
Why would a coded version take more than twice the amount of time? I would have expected it to at the very least be as quick as the manual process.
What i have noticed is a diminished Model State operation time in both manual & coded version. For example, Each model state in my assembly changes the height by a column number so the occurring model change per state is exactly the same for each model state. That being the case, why would the model update operation timing change so much between model state changes?
Activate MS2 = 1.2 seconds
Activate MS3 = 2 seconds
Activate MS4 = 2.7 seconds
Activate MS5 = 3.4 seconds
Activate MS6 = 3.7 seconds
Activate MS7 = 4 seconds
Activate MS20 = 9.1 seconds
Activate MS2 again = 4.2 seconds
I should note that all model states have been activated and viewed so i dont think its down to any initial part generation.. I should also note that if i open the sub assembly that has the 30 model states, i can switch between them instantly. The delay appears to be switching the model state from the top level to the sub assembly
So my questions:
1. Why would the Pattern independent version take so long to process?
2. Is there any way to reduce the time overhead in placing the assemblies with a model or changing to a model state?
This is an automation process but i have to consider the panel qty we usually work with and its much bigger than 30, usually 150. so 150 x on average 15 seconds per model state change = about 45 mins which is probably slower than a manual process.
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.