Pattern inside boundary

Pattern inside boundary

pball
Mentor Mentor
7,354 Views
21 Replies
Message 1 of 22

Pattern inside boundary

pball
Mentor
Mentor

Maybe I should have just started an Idea station post for this but I wanted to see if anyone had input on this first.

 

I'm patterning holes on an oddly shaped plate and currently the only way I can keep holes from ending up too close to the edges is to manually suppress them in the pattern. This is extremely tedious and if I change something has to be updated manually. It would be awesome for a pattern to be able to apply inside of a boundary.

 

Is there some trick to do this more easily today or would you support an idea to add this feature to patterns?

 

For example only keep holes that are fully inside the selected profile.

Capture.PNG

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
7,355 Views
21 Replies
Replies (21)
Message 2 of 22

SBix26
Consultant
Consultant

There is probably already an idea like this in the Inventor Ideas forum, but I'm too lazy to go look for it myself... but I would absolutely support such an idea.  For that matter I may have already done so and forgotten it!

 

But one way to do what you want is to create the solid of the hole boundary first, place the hole pattern, then add the material on the outside. 

 

If you would be willing to post your part, or a similar (non-proprietary) example along with what version of Inventor you're using, I would try to come up with a robust technique to save you from repetitive stress injury.

 

Update: see attached 2018 file that might give you some ideas.

Pattern Inside Boundary.png

 


Sam B
Inventor Pro 2019.3 | Windows 7 SP1
LinkedIn

0 Likes
Message 3 of 22

johnsonshiue
Community Manager
Community Manager

Hi! Indeed, it would be great if we have this kind of pattern (Fill pattern). At the moment, you could use Sketch Point Driven pattern to work around the limitation.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 4 of 22

S_May
Mentor
Mentor
Message 5 of 22

Jesper_S
Collaborator
Collaborator

Hi.

 

You could try this iLogic rule.

Sub Main()

    Dim oDoc As PartDocument = TryCast(ThisDoc.Document, PartDocument)
    If oDoc Is Nothing Then
      MessageBox.Show("This rule works with part documents only.", "iLogic Rule", _
        MessageBoxButtons.OK, MessageBoxIcon.Warning)
      Exit Sub
    End If
    Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
    
    'this rule works with only one rect. pattern only
    'provided directly by item number
    Dim oPattern As RectangularPatternFeature _
        = oDef.Features.RectangularPatternFeatures.Item(1)
    
    'restore all pattern elements in order to get access to their faces
    For Each oElt As FeaturePatternElement In oPattern.PatternElements
        If oElt.Suppressed Then oElt.Suppressed = False
    Next
    oDoc.Update()
    ThisApplication.ActiveView.Update
    Beep
    
    Dim oBoundarySketch As PlanarSketch = oDef.Sketches.Item("Boundary")
    
    'temporary sketch for profile
    Dim oSketch As PlanarSketch = oDef.Sketches.Add(oBoundarySketch.PlanarEntity,False)
    oSketch.Visible = False
    
    'project boundary
    For Each oE As SketchEntity In oBoundarySketch.SketchEntities
        Call oSketch.AddByProjectingEntity(oE)
    Next
    
    'project parent hole
    Dim oHole As HoleFeature = TryCast(oPattern.ParentFeatures.Item(1), HoleFeature)
    If oHole Is Nothing Then
        MessageBox.Show("This rule works with hole feature pattern only.", "iLogic Rule", _
            MessageBoxButtons.OK, MessageBoxIcon.Warning)
        Exit Sub
    End If
    Dim oEdge As Edge = oHole.SideFaces.Item(1).Edges.Item(1)
    Call oSketch.AddByProjectingEntity(oEdge)
    
    'project holes pattern
    For Each oElt As FeaturePatternElement In oPattern.PatternElements
        If oElt.Faces.Count > 0 Then
            oEdge = oElt.Faces.Item(1).Edges.Item(1)
            Call oSketch.AddByProjectingEntity(oEdge)
        End If
    Next
    
    ' Create a profile.
    Dim oProfile As Profile = oSketch.Profiles.AddForSolid(True)
    
    For Each oPath As ProfilePath In oProfile
        If oPath.Count = 1 Then
            Dim oPE As ProfileEntity = oPath.Item(1)
            If oPE.CurveType = Curve2dTypeEnum.kCircleCurve2d Then
                Dim oSkE As SketchEntity = oPE.SketchEntity
                Dim oGreenCircle As SketchCircle = CType(oSkE, SketchCircle)
                Dim oFPE As FeaturePatternElement = GetEltByGreenCircle(oGreenCircle)
                If oFPE IsNot Nothing Then
                    If oPath.AddsMaterial = True Then
                    oFPE.Suppressed = True 'should be suppressed
                    End If
                End If
            End If
        End If
    Next
    'delete temporary sketch
    oSketch.Delete()
    oDoc.Update()
    Beep()
End Sub


Function GetEltByGreenCircle( _
  ByRef oGreenCircle As SketchCircle) As FeaturePatternElement
    'returns FPE corresponding to the given SketchCircle object
    
    If oGreenCircle Is Nothing Then Return Nothing    
    Dim oEdge As Edge
    Try
        oEdge = CType(oGreenCircle.ReferencedEntity, Edges).Item(1)
    Catch ex As Exception
        Return Nothing
    End Try
    
    Dim oFace As Face
    If oEdge.Faces.Item(1).SurfaceType = SurfaceTypeEnum.kCylinderSurface Then
        oFace = oEdge.Faces.Item(1)
    Else
        oFace = oEdge.Faces.Item(2)
    End If
    
    If oFace.CreatedByFeature.Type = ObjectTypeEnum.kHoleFeatureObject Then
        Return Nothing
    End If
    
    Dim lKey As Long = oFace.TransientKey
    
    Dim oPattern As RectangularPatternFeature _
        = CType(oFace.CreatedByFeature, RectangularPatternFeature)
    
    For Each oElt As FeaturePatternElement In oPattern.PatternElements
        If oElt.Faces.Count > 0 Then
            If lKey = oElt.Faces.Item(1).TransientKey Then
                Return oElt
            End If
        End If
    Next
    Return Nothing
End Function 'GetEltByGreenCircle

Suppresses all Holefeatures ouside a sketch called "Boundary"

 

Not sure if it works  but you could try.

 

Attached a File also. Think its a IV 2013 file.


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Message 6 of 22

pball
Mentor
Mentor

There is an idea for this with lots of support, but it's apparently been put in the backlog as of two years ago.

 

https://forums.autodesk.com/t5/inventor-ideas/borders-on-feature-patterns/idi-p/3817784

 

@SBix26 

Your idea seems the most robust so far what I've tried. I'm going to play around with a programmatic solution more but I'll fall back to this if that doesn't pan out.

 

@S_May 

I'm guessing you are using iLogic to do that? Could you share?

 

@Jesper_S 

I found that code at Mod the Machine also and played with it some. It works fine in that sample part but I've noticed two issues with it. First it didn't remove any partial holes that are on the edge of my part. Secondly the boundary sketch apparently can only have a single closed boundary, so it doesn't seem possible to constrain the boundary as that would create other lines.


I'm either going to work off that coded example or try something myself. I'll report back if I get something good working.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 7 of 22

S_May
Mentor
Mentor

@pball 

 

the 3d modell with ilogic...

 

2019-01-24 19_51_58-Autodesk Inventor Professional 2019 - [FitPatternToSketch.ipt].png

Message 8 of 22

pball
Mentor
Mentor

@S_May That iLogic relies on an external DLL it seems.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 9 of 22

Sergio.D.Suárez
Mentor
Mentor

Maybe this article is of interest to you

 

https://modthemachine.typepad.com/my_weblog/2013/03/control-feature-creation-based-on-user-defined-b...

 

 

I have tried the rule and it works very well


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 10 of 22

pball
Mentor
Mentor

I have already tried that and mentioned it in a previous reply, not to mention someone else posted the full code above. Unfortunately that solution does not work for me as it cannot remove holes that are along the edge of a part.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 11 of 22

Jesper_S
Collaborator
Collaborator

Hi.

 

Have you found a solution to this problem?


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
0 Likes
Message 12 of 22

Sergio.D.Suárez
Mentor
Mentor

 

The rule that I previously shared carries out this task, maybe for your particular case it may be useful, greetings


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 13 of 22

pball
Mentor
Mentor

I have not found a method that suits my needs, but there at least two different examples that work in this thread. Try them out and see if they work for you.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style

Userscript to edit forum links to jump to first unread post
Jump To First Post Userscript
0 Likes
Message 14 of 22

johnsonshiue
Community Manager
Community Manager

Hi! Indeed, it is true that Inventor does not yet have the ability to do "Fill Pattern."  Patterning a feature or body within a close boundary in equal spacing. There are some workarounds like shown by experts in above postings.

A low-tech technique is the following.

 

1) Create a sketch with a given boundary.

2) Create circles within the boundary and add equal constraints and tangent constraints so that the circles touch each other.
3) After you populate the circles, you can turn the circle centers to center points.

4) Use Sketch-Driven Pattern to replicate the feature over the points.

 

It is labor-intensive but it should work.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 15 of 22

tmoxam
Advocate
Advocate

Hi all

 

we have used the code above to create a pattern of holes and to remove (suppress) the holes outside a specified boundary. the code itself works well but only works with a single rectangular pattern. 

However, in our case we use pairs of holes in the pattern. What i would like is for the ilogic to recognize and remove both holes from an element in the pattern. Currently the code is identifying individual holes and removing the ones outside the boundary.  Since we use pairs, an odd number of holes is no good to me. 

How can i get the code to recognize both holes of an element and suppress them both if one is outside the boundary?

0 Likes
Message 16 of 22

knguyen_
Advocate
Advocate

Is this idea ever get developed? We are in Inventor 2023 already. I do perforated sheet metal for kitchen equipment everyday, this feature would make my daily designing task much less labour-intensive 

0 Likes
Message 17 of 22

johnsonshiue
Community Manager
Community Manager

Hi! At the moment, the sketch-driven pattern is the closest workaround. It would be great if Fill Pattern is supported. This is a request we are aware of but we don't have a good solution yet unfortunately.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 18 of 22

knguyen_
Advocate
Advocate

Hi

I have tried to use sketch-driven for my application. However, it uses 2D sketch as reference so it is not good practice to also pattern the 2D sketch, it simply does not work with iLogic models. I hope your team will find a good solution soon 

0 Likes
Message 19 of 22

mnemetchek
Contributor
Contributor

I get an error on the rule. I'm running Inventor 2023, may I be doing something wrong or is there an update?

Thanks

Myles

0 Likes
Message 20 of 22

johnsonshiue
Community Manager
Community Manager

Hi! The Boundary Pattern workflow is officially supported on Inventor 2025. Please upgrade to 2025 and try the workflow.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer