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!
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
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
(Not an Autodesk Employee)
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?
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
(Not an Autodesk Employee)
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.
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
(Not an Autodesk Employee)
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.
Nope. It sounded better in my head than it worked in reality.
Wesley Crihfield
(Not an Autodesk Employee)
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!
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
(Not an Autodesk Employee)
Would you be able to advise a way to do this automatically using Ilogic?
Yes, if I knew which I wanted to suppress.
Wesley Crihfield
(Not an Autodesk Employee)
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
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
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.