How to split a surface from rectangular pattern feature occurrence

How to split a surface from rectangular pattern feature occurrence

SandmanINV
Advocate Advocate
1,026 Views
10 Replies
Message 1 of 11

How to split a surface from rectangular pattern feature occurrence

SandmanINV
Advocate
Advocate

Hi everybody, 

I have a surface with random boundary. I want to split it to many smaller surface. But i can not find out the way quickly.

Currently, I import a autocad file, create a boundary patch surface, create a rectangular sketch and extrude surface. 

Split extrude surface. Pattern extrude surface to continue split.

But now, i can not split from pattern elements. How should i do ?

Thank you.

Here is my code.

Private Sub CommandButton3_Click()
Dim dientich As Double

' Dim oDoc As PartDocument
 '   Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject)
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject, _
    ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject, kMetricSystemOfMeasure))
    Dim oCompDef As PartComponentDefinition
    Set oCompDef = oDoc.ComponentDefinition
    
    Dim oRefComponents As ReferenceComponents
    Set oRefComponents = oCompDef.ReferenceComponents
    
    ' Create a ImportedComponentDefinition based on an AutoCAD file.    Dim oImportedCompDef As ImportedComponentDefinition
    Set oImportedCompDef = oRefComponents.ImportedComponents.CreateDefinition("C:\Users\Sand Man\Desktop\Drawing1.dwg")
    
    Dim oImportedDWGDef As ImportedDWGComponentDefinition
    
    If oImportedCompDef.Type = kImportedDWGComponentDefinitionObject Then
        Set oImportedDWGDef = oImportedCompDef
    Else
        End
    End If
    
    Dim oMatrix As Matrix
    Set oMatrix = ThisApplication.TransientGeometry.CreateMatrix
    oMatrix.SetTranslation ThisApplication.TransientGeometry.CreateVector(0, 0, 10)
    
    oImportedDWGDef.Transformation = oMatrix
    
    ' Create the ImportedComponent
    Dim oImportedComponent As ImportedComponent
    Set oImportedComponent = oRefComponents.ImportedComponents.Add(oImportedDWGDef)
    
    Dim oImportedDWGComponent As ImportedDWGComponent
    
    If oImportedComponent.Type = kImportedDWGComponentObject Then
        Set oImportedDWGComponent = oImportedComponent
        
        Dim oSk As PlanarSketch
        Set oSk = oCompDef.Sketches.Add(oCompDef.WorkPlanes(3))
        
        ' Get the DWGBlockDefinition for model space.        Dim oDWGModelSpaceDef As DWGBlockDefinition
        Set oDWGModelSpaceDef = oImportedDWGComponent.ModelSpaceDefinition
        
        ' Project DWG entities to planar sketch.
        Dim oDWGEntity As DWGEntity
        For Each oDWGEntity In oDWGModelSpaceDef.Entities
         
            Call oSk.AddByProjectingEntity(oDWGEntity)
        Next
    End If
oImportedDWGComponent.Visible = False
Dim oProfile As Profile
Set oProfile = oSk.Profiles.AddForSurface


Dim opatchdef As BoundaryPatchDefinition
Set opatchdef = oCompDef.Features.BoundaryPatchFeatures.CreateBoundaryPatchDefinition
opatchdef.BoundaryPatchLoops.Add oProfile

Dim opatchsurface As BoundaryPatchFeature
Set opatchsurface = oCompDef.Features.BoundaryPatchFeatures.Add(opatchdef)

Dim oFrontFace As Face
Set oFrontFace = opatchsurface.Faces.Item(1)

'Dim odientichtoanbo As Double
'odientichtoanbo = oFrontFace.Evaluator.Area
'Set oFrontFace = oextrude.StartFaces.Item(1)

''''''''''''''''''
Dim oWorkplanes As WorkPlanes
Set oWorkplanes = oDoc.ComponentDefinition.WorkPlanes

Dim oWorkplane As WORKPLANE
'Set oWorkplane = oPartDoc.

Dim oSketch As PlanarSketch
Set oSketch = oCompDef.Sketches.Add(oFrontFace, False)


Dim oTransi As TransientGeometry
Set oTransi = ThisApplication.TransientGeometry


Dim oRectangleLines As SketchEntitiesEnumerator
Set oRectangleLines = oSketch.SketchLines.AddAsTwoPointRectangle( _
oTransi.CreatePoint2d(0, 0), _
oTransi.CreatePoint2d(5, 15))

Set oProfile = oSketch.Profiles.AddForSurface

Dim oextrude As ExtrudeFeature
Set oextrude = oCompDef.Features.ExtrudeFeatures.AddByDistanceExtent(oProfile, 5, kSymmetricExtentDirection, kSurfaceOperation)
'Dim o2dpath As SplitFeature
'Set o2dpath = oCompDef.Features.CreatePath(oRectangleLines)
 Dim osur As SurfaceBody
 Set osur = opatchsurface.SurfaceBodies.Item(1)
Dim oworksface As WorkSurface
Set oworksface = oextrude.SurfaceBody.Parent

Dim oSplit As SplitFeature
Set oSplit = oCompDef.Features.SplitFeatures.SplitFaces(oworksface, True, osur)
oworksface.Visible = False
'pattern
Dim opartdef As PartComponentDefinition
Set opartdef = oDoc.ComponentDefinition
Dim ocolextrude As ObjectCollection
Set ocolextrude = ThisApplication.TransientObjects.CreateObjectCollection
Call ocolextrude.Add(oextrude)

Dim orecpa As RectangularPatternFeature
Set orecpa = oCompDef.Features.RectangularPatternFeatures.Add(ocolextrude, opartdef.WorkAxes.Item(1), False, 6, 5, kDefault, , opartdef.WorkAxes.Item(2), True, 5, 15, kDefault, , kIdenticalCompute)

 'For i = 9 To 12
'orecpa.PatternElements.Item(i).Suppressed = True
'Next
'Dim obodyi As WorkSurface
'Set obodyi = orecpa.PatternElements.Item(3).Parent
'Set obodyi = orecpa.SurfaceBodies.Item(1)

Set oSplit = oCompDef.Features.SplitFeatures.SplitFaces(odofyi, True, osur)

 ThisApplication.CommandManager.ControlDefinitions.Item("AppViewCubeHomeCmd").Execute
oDoc.Update
End Sub

 

0 Likes
1,027 Views
10 Replies
Replies (10)
Message 2 of 11

bradeneuropeArthur
Mentor
Mentor
could you upload a picture or a file with what you need?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 3 of 11

SandmanINV
Advocate
Advocate

Thank you for your help. Here is my picture. I split by hand in this file. 

Capture.JPG

0 Likes
Message 4 of 11

bradeneuropeArthur
Mentor
Mentor
could you show me the picture without the splits too?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 5 of 11

SandmanINV
Advocate
Advocate

I want inventor split any surface with a rectangular.

Capture.JPG

0 Likes
Message 6 of 11

bradeneuropeArthur
Mentor
Mentor

Maybe this is an idea?

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 11

SandmanINV
Advocate
Advocate
i dont understand your mind. Can you explain more ?
Thank you.
0 Likes
Message 8 of 11

SandmanINV
Advocate
Advocate

Can any body help, pls 

0 Likes
Message 9 of 11

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Please take a look at the attached file in my previous post.

This will explain my idea...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 10 of 11

SandmanINV
Advocate
Advocate

Hi,

Thank you for your idea. I opened your file. But maybe i am stupid. I don't understand what you mind ?

like my picture i uploaded , i want to split a surface with random boundary line. 

My way is extrude surface and split mother surface tho many child surfaces automatically. 

After saw your part, i dont understand how to solve my problem...

Thanks you. 

0 Likes
Message 11 of 11

bradeneuropeArthur
Mentor
Mentor

Hi,

 

I tried it to do a different way.

I made the separate surfaces already and then I made the pattern.

This is much easier regarding the split method. because you don't need it, to my opinion.

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature