Simplify parts - like a snake - not python, ilogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
A Concept
I'm not sure if this will ever get used but finding a way to simplify third party components is always a distant thought.
The 2022 simplification tools are an improvement but still clunky - so imagine a snake, swallowing the component.
On each plane along the rib cage is a rectangle with chamfered corners, reduce the dimension to each side until an interference is detected then repeat for the next dimension.
Note - the 'Snake' here is called 'SimpleTesyA'
An assembly is created where the 'victim' (Mobile-receiver plate) is placed inside the 'Snake'.
Here the 'belly' of the snake is a lofted void - the four sides of the rectangle are:
Layer0_N, Layer0_E, Layer0_S & Layer0_W (North, East, South & West)
then
Layer1_N, Layer1_E, Layer1_S & Layer1_W (repeat across the layers to create the loft)
So far this has been tested on one dimension & it does work but there must be many improvements to add.
I'm wondering what techniques can be used to swap in the parameters.
The logic is:
Reduce the parameter until there's an interference
Back off the parameter (1mm?) - Store the value
Move onto the next parameter
Repeat
The stored values could drive a copy of 'SimpleTesyA' but the loft create a solid not a void (-1mm?) - which becomes the simplified part (keep out zone).
This is the start, carrying on with clunky code will take me an age & I know there's slicker approaches but I'm keen to see it working this year!
Not sure it could work on broken surface bodies (ones with holes in) - don't think interference 'sees' surfaces.
Interference = False
For index As Integer = 100 To 30 Step - 1
ThisDoc.Document.Rebuild()
If Interference =True Then Exit For
west1 = index
'MessageBox.Show(Interference, "ln 7")
'MessageBox.Show(west1, "ln 8")
InventorVb.DocumentUpdate(True)
Parameter("SimpleTesyA:1", "Layer0_W") = west1
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAsmDoc.ComponentDefinition
' Add each occurrence in the assembly to the object collection.
Dim oCheckSet As ObjectCollection
oCheckSet= ThisApplication.TransientObjects.CreateObjectCollection
Dim oOcc As ComponentOccurrence
For Each oOcc In oAsmCompDef.Occurrences
oCheckSet.Add (oOcc)
Next
' Call the AnalyzeInterference method, passing in a single
' collection. This will cause it to compare everything against
' everything else.
Dim oResults As InterferenceResults
oResults = oAsmCompDef.AnalyzeInterference(oCheckSet)
Dim oResult As InterferenceResult
Dim iCount As Integer
iCount = 0
For Each oResult In oResults
If oResult.Volume > .0001 Then
iCount = iCount + 1
End If
ThisApplication.ActiveView.Update
Next
iCount = 0
For Each oResult In oResults
If oResult.Volume > .0001 Then
iCount = iCount + 1
MessageBox.Show(west1, "ln 47")
west1b = west1+1
Interference = True
If Interference =True Then Exit For
End If
Next
Next
Regards
Andrew