ilogic - Edit rectangular pattern

ilogic - Edit rectangular pattern

JBerns
Advisor Advisor
4,736 Views
24 Replies
Message 1 of 25

ilogic - Edit rectangular pattern

JBerns
Advisor
Advisor

Community,

 

Using iLogic in an assembly, I can create a rectangular pattern of a component using Patterns.AddRectangular.

 

How do you edit the Pattern quantity and spacing after it is created?

 

So far, my solution has been to delete the pattern, place the component again, and create the pattern again. This can't be the most efficient method. I have not been able to find any iLogic code examples where a pattern is edited, only created. I am sure the editing solution could be applied to a circular pattern in the event I need that in the future.

 

Thanks for your time and attention. I look forward to the replies.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes
Accepted solutions (3)
4,737 Views
24 Replies
Replies (24)
Message 21 of 25

t_fransman
Advocate
Advocate

I have a pattern for a belt path, several types with inclines or flat etc. I switch which sketch the pattern in the rectangular pattern references manually, depending on the situation.

The path is a loop, and i use it to drive occurrences in a sketch, then in turn, I use that to drive assembly (belt sections) around the same loop,

in an assembly. I now look at the "curve length" after changing between sketches and plug it into an equation every time (... sometimes easy to forget).

0 Likes
Message 22 of 25

t_fransman
Advocate
Advocate

t_fransman_0-1756406518422.png Curve Length manually copied into equation above. ( 2736.9357 in / BeltPitchDriven ) * 1 ul

 

 

0 Likes
Message 23 of 25

t_fransman
Advocate
Advocate

t_fransman_0-1756407223761.png

 

0 Likes
Message 24 of 25

WCrihfield
Mentor
Mentor

OK.  We are talking about a RectangularPatternFeature here, instead of a RectangularOccurrencePattern.  It looks like this may include a feature or functionality that is available in either Inventor 2025 or 2026, but I am still using Inventor 2024.3.5.  When you step down through the RectangularPatternFeature.Definition property to get to the RectangularPatternFeatureDefinition object, we can start to see some properties and methods in that area.  Such as the RectangularPatternFeatureDefinition.BoundarySetting (new in 2025) and the RectangularPatternFeatureDefinition.HasBoundarySettingConfigured (also new in 2025).  That first property returns a PatternBoundarySetting object.  It seems like you would have to dig into that.  I can't create a good example for you since I am using older version, but here is some starter code.  I'm also leaving for the day, so I may check back tomorrow.

Sub Main
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oADoc As AssemblyDocument = TryCast(ThisDoc.Document, Inventor.AssemblyDocument)
	If oADoc Is Nothing Then
		MessageBox.Show("Rule named '" & iLogicVb.RuleName & "' did not run because no assembly obtained!", _
		"Wrong Document Type", MessageBoxButtons.OK, MessageBoxIcon.Stop)
		Return
	End If
	Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
	
	'assembly occurrence patterns (can be circular, rectangular, or feature based)
	Dim oOccPatts As OccurrencePatterns = oADef.OccurrencePatterns
	
	'rectangular feature patterns
	Dim oRectPattFeats As RectangularPatternFeatures = oADef.Features.RectangularPatternFeatures
	
	'circular feature patterns
	Dim oCircPattFeats As CircularPatternFeatures = oADef.Features.CircularPatternFeatures
	
	Dim oRectPattFeat As RectangularPatternFeature = oRectPattFeats.Item("Belt Loop Pattern")
	Dim oRectPattFeatDef As RectangularPatternFeatureDefinition = oRectPattFeat.Definition
	
	'number of instances in the X direction
	Dim oXCount = oRectPattFeatDef.XCount
	
	'spacing between instances in X direction
	Dim oXOffset = oRectPattFeatDef.XSpacing
	
	'number of instances in the Y direction
	Dim oYCount = oRectPattFeatDef.YCount
	
	'spacing between instances in Y direction
	Dim oYOffset = oRectPattFeatDef.YSpacing
	
End Sub

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 25 of 25

t_fransman
Advocate
Advocate

It's just a rectangular feature pattern in a skeleton, but has various sketches (Pattern a Surface so it's not visible in the assembly i follow the surface). And each has curves in the loop. Sorry i looked at something posted previously, way too advanced for me.  I thought

my request was easier. 

0 Likes