Uneven pattern with parameters

Uneven pattern with parameters

Anonymous
Not applicable
1,147 Views
13 Replies
Message 1 of 14

Uneven pattern with parameters

Anonymous
Not applicable

Hi,

 

The single bar on the side needs to be patterned unevenly across the length. However due to this being a parametric model, there can be a ranging number of these from 3-30 meaning the sketch driven pattern may not work properly. Is there any way I can do this uneven pattern with custom number of these features? Thanks!cadfile5.JPG

0 Likes
Accepted solutions (1)
1,148 Views
13 Replies
Replies (13)
Message 2 of 14

WCrihfield
Mentor
Mentor

Use a sketch pattern within the sketch that is driving this feature.  And use a UserParameter as the Quantity value.  That Quantity Parameter will do the math comparing part length and spacing between the lines, to figure how many it needs.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 14

Anonymous
Not applicable

Hi,

 

Is this what you mean? I am patterning the point within the sketch however can only do this in even spacings? Is there a way to do this unevenly?cadfile 7.JPG

0 Likes
Message 4 of 14

WCrihfield
Mentor
Mentor

Oh, OK.  I guess I misunderstood the original post.  So, you're wanting to create a set of lines (or points) that are all uneven?  In that case, you're probably stuck with doing it manually.  To create a set of geometry using code automation, you're going to have to be able to explain the geometry and its placement/positioning mathematically, one way or another.  I am currently unaware of a randomizing method for creating geometry in Inventor right now.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 14

Anonymous
Not applicable

Yes essentially a hybrid between rectangular pattern and sketch driven where the user inputs how many of them and spacing between and the model shows this. I'll have a go and see what method I can come up with. Any other help is much appreciated. 

0 Likes
Message 6 of 14

WCrihfield
Mentor
Mentor

Would a sketch pattern of a sketch pattern work for your application?  For example...first sketch a set of geometry, to use as the 'random' portion, then create a regular sketch pattern with all of the first set of geometry selected.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 14

Anonymous
Not applicable

Hi,

 

I'm not quite sure what you mean by this. Would you be able to edit the file i sent in the inital forum post and send it back with your suggestions? Thanks. 

0 Likes
Message 8 of 14

WCrihfield
Mentor
Mentor

Nope. It sounded better in my head than it worked in reality.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 9 of 14

Anonymous
Not applicable

Do you know how to supress a certain occurence within the sketch driven pattern using ilogic. I have never used it but i understand its possible? Would you be able to explain it simply as I'm not very experienced with this!

 

0 Likes
Message 10 of 14

WCrihfield
Mentor
Mentor

Sure. Once you've created either a Pattern in a Part using one of the tools within the (3D Model tab / Pattern panel), you can click the little plus sign next to that feature in the Model browser, then right click on one of the Occurrences, then choose Suppress.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 11 of 14

Anonymous
Not applicable

Would you be able to advise a way to do this automatically using Ilogic? 

0 Likes
Message 12 of 14

WCrihfield
Mentor
Mentor

Yes, if I knew which I wanted to suppress.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 13 of 14

Anonymous
Not applicable

Hi,

 

I would like to suppress a feature called '140 JR PATTERN'. Would you be able to write a code to help? This didn't work for me:

This is the error: "ThisAssembly: This document "Parametric 1" is not an assembly."

Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument
Dim oPattern As OccurrencePattern 
'calls the pattern by name
oPattern = oDoc.ComponentDefinition.OccurrencePatterns.Item("140 JR PATTERN") 

oPattern.OccurrencePatternElements(3).Components(1).OccurrencePatternElements(3).Suppressed=True

 

0 Likes
Message 14 of 14

WCrihfield
Mentor
Mentor
Accepted solution

Try this:

In the code below, I'm showing 3 different ways to do it.  I currently have the first two options commented out.

 

 

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition

''Option 1
'For Each oFeat As PartFeature In oDef.Features
'	If oFeat.Name = "140 JR PATTERN" Then
'		oFeat.Suppressed = True
'	End If
'Next

''Option 2
'Try
'	Feature.IsActive("140 JR PATTERN") = False
'Catch
'	MsgBox("Couldn't turn the '140 JR PATTERN' off.")
'End Try

''Option 3
For Each oRPatt As RectangularPatternFeature In oDef.Features.RectangularPatternFeatures
	If oRPatt.Name = "140 JR PATTERN" Then
		Dim oFeats As ObjectCollection = oRPatt.Definition.ParentFeatures
		oRPatt.Suppressed = True
		For Each oFeat As Object In oFeats
			If oFeat.Type = ObjectTypeEnum.kExtrudeFeatureObject Then
				oFeat.Suppressed = True
			ElseIf oFeat.Type = ObjectTypeEnum.kWorkPlaneObject Then
				oFeat.Visible = False
			End If
		Next
	End If
Next

Let me know how these work for you.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes