Message 1 of 5
ilogic: Split Multiple bodies using surface
Not applicable
03-31-2021
11:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying.... and failing to write some ilogic for inventor 2018 which will split multiple bodies using a surface.
the amount of bodies changes as its rectangularly patterned around a sketch (which changes)
what i have at the moment is:
Dim oApp As Application
Dim oPrt As PartDocument
Dim oPRTCD As PartComponentDefinition
Dim oSB As SurfaceBody
Dim oFT As PartFeatures
Dim oRPF As RectangularPatternFeatures
Dim oFPE As FeaturePatternElement
Dim oSplit As SplitFeature
Dim oREFSKT As Sketch
Dim oCut = CBCT2
Dim oThing As FeaturePatternElements
oApp = ThisApplication
oPrt = oApp.ActiveDocument
oPRTCD = oPrt.ComponentDefinition
oSB = oPRTCD.SurfaceBodies.oThing
oFT = oPRTCD.Features
oRPF = oFT.RectangularPatternFeatures.
CountBody = oPRTCD.SurfaceBodies.Count
oThing = "Feature pattern2"
For Each body In oPRTCD.SurfaceBodies
On Error Resume Next
For Each item In oREFSKT.drivenby
If item.name = oRPF.name Then
oSB = oPRTCD.SurfaceBodies.Item(countbody)
oSplit = oFT.SplitFeatures.SplitBody(oSB,oRPF)
countbody = oPRTCD.SurfaceBodies.Count
End If
Next
Next where CBCT2 is the surface used to cut and rectangular pattern2 is where the bodies are made.
ive got this far from digging through the forums and google.
any help would be greatly appreacated