Hello!
Is it possible to suppress an occurrence of a pattern in part enviroment using iLogic? I saw something for aseembly enviroment, but I can't make it work for part. My iLogic knowledge is quite basic.
If you have a rule for this, please help me!
Regards
Hi!!
I think is not possible because the software can't guess which occurrence to suppress.
Instead, you may create several Patterns, each one with the propper configuration, and use ilogic to supress the Patterns you don't need for each specific case.
Regards
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Yes, it is possible. difficult, but possible - and you have to be careful not to try to change the suppression on the first item, because it will error out without telling you why.
Dim oPattern As RectangularPatternFeature oPattern = ThisDoc.Document.ComponentDefinition.Features.RectangularPatternFeatures.Item("<pattern name>") Dim oElement As FeaturePatternElement For Each oElement In oPattern.PatternElements if oElement.index = 1 then 'do nothing - you're not allowed else oElement.suppressed = True 'or false end if Next ThisDoc.Document.update
I know this is an old post, but they are everywhere, with no solution to be found.
Inventor 2017
I'm working with a "sketch driven pattern" in a part.
Was looking at the script and only got the whole
pattern to suppress. Was not able to get individual occurrences suppressed.
how do we get the 5, 6,7 occurrence to suppress.
have not seen much on this, mostly with assemblies,
any help, thanks Sergio
Please read your last topic.
And
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:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !
the option of pattern properties is not what i was looking for.
that option only gives me an if statement to suppress the whole pattern.
I was looking to suppress the occurrences one at a time.
thanks for the help.
@serpennica wrote:Was looking at the script and only got the whole
pattern to suppress. Was not able to get individual occurrences suppressed.
how do we get the 5, 6,7 occurrence to suppress.
have not seen much on this, mostly with assemblies,
This isn't a question of part vs. assembly, it's simply a question of programming. There are many ways to only suppress those occurrences. Probably a Select Case is one of the simpler methods:
Dim oPattern As RectangularPatternFeature oPattern = ThisDoc.Document.ComponentDefinition.Features.RectangularPatternFeatures.Item("<pattern name>") For Each oElement As FeaturePatternElement In oPattern.PatternElements Select Case oElement.index Case 5,6,7 oElement.suppressed = True 'or false End Select Next ThisDoc.Document.update
Actually, to suppress specific elements, you don't even need to iterate through the elements. You can suppress them directly like this:
Dim oPattern As RectangularPatternFeature oPattern = ThisDoc.Document.ComponentDefinition.Features.RectangularPatternFeatures.Item("<pattern name>") Dim oElements As FeaturePatternElements = oPattern.PatternElements oElements(5).Suppressed = True oElements(6).Suppressed = True oElements(7).Suppressed = True ThisDoc.Document.update
Perfect. That was it.
changed the rectangular pattern to sketch driven pattern and used a function to drive the true/false. now I can get a dialog box "forms" to select the element i want to remove.
thank you.
Perfect. That was it.
changed the rectangular pattern to sketch driven pattern and used a function to drive the true/false. now I can get a dialog box "forms" to select the element i want to remove.
thank you.