Error in component pattern when feature pattern is suppressed

Error in component pattern when feature pattern is suppressed

mat_hijs
Collaborator Collaborator
1,091 Views
8 Replies
Message 1 of 9

Error in component pattern when feature pattern is suppressed

mat_hijs
Collaborator
Collaborator

I have a sheet metal panel, on each side (left, right, top, bottom) I made a hole and then a pattern of that hole. This works perfectly. I placed this part in an assembly and authored it for icopy. Still works perfectly fine, I have used this to make lots of these panels.

Now I'd like to add screws to all the holes, so my idea was to add one to the first hole in every side and then create a component pattern that follows the feature pattern in the part. And this also works perfectly.

 

Except when I want to suppress the holes in one or more sides. With ilogic, I suppressed the holes in the part, I suppressed the component pattern. But I still get an error because the initial constraint of the first screw was made to the geometry that has now been suppressed, so of course that makes sense. But how can I work around this?

Am I missing something really obvious? Would my only option be to create work geometry in the part to constrain the screw to?

0 Likes
Accepted solutions (1)
1,092 Views
8 Replies
Replies (8)
Message 2 of 9

blandb
Mentor
Mentor

Are you also setting the constraint to be false as well?

Autodesk Certified Professional
0 Likes
Message 3 of 9

mat_hijs
Collaborator
Collaborator

I tried to suppress te constraint if that's what you mean, but I stil got an error.

0 Likes
Message 4 of 9

blandb
Mentor
Mentor

Can you share your model?

Autodesk Certified Professional
0 Likes
Message 5 of 9

foolishgrunt
Advocate
Advocate

Don't know if it his would be better for your use case or not. But you could constrain the screw by defining distances from the edges of the part, and link those distances to the dimensions you used to define the original hole location. (Those dims should not be suppressed when you suppress the hole feature.)

0 Likes
Message 6 of 9

johnsonshiue
Community Manager
Community Manager

Hi! I guess you may need to suppress the component pattern before suppressing the feature pattern. Then, unsuppress the feature pattern before unsuppressing the component pattern.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 7 of 9

mat_hijs
Collaborator
Collaborator

I am still dealing with this issue, has anyone ever found a solution to this?

0 Likes
Message 8 of 9

johnsonshiue
Community Manager
Community Manager

Hi! I am not aware of a solution other than what had been stated before. There is a dependency here. The Component Pattern is driven by the Feature Pattern. When the Feature Pattern is suppressed first, the Component Pattern will become sick. This is why you need to suppress the Component Pattern first before suppressing the Feature Pattern. Such conditional sequential operations can be achieved by an iLogic rule. But it cannot be done easily within iAssembly/iPart or Model States unfortunately.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 9 of 9

mat_hijs
Collaborator
Collaborator
Accepted solution

@johnsonshiue The solution stated before doesn't work. I have tried any possible order of suppressing and unsuppressing but the result is the same. I think this is because even when the occurrence pattern is suppressed it still remains sick, which I'm not sure if this is by design or a bug.

I did come up with a solution that seems to work, but it's not pretty. I attached a simple example, changing the parameter "Active" in the assembly will trigger the rule.

Basically I created another pattern, a dummy pattern of the origin with 1 occurrence over a distance of 0 mm that will always be active. The iLogic code sets to which feature pattern the occurrence pattern is linked.

Here is the code:

' Suppress Part2 and the corresponding Constraints
Component.Visible("Part2") = Active
Constraint.IsActive("Insert_Part2") = Active

' Set a reference to the Assembly Document
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument

' Set a reference to the Assembly Component Definition
Dim oAsmCompDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition

' Set a reference to the Component Occurrences
Dim oOccurrences As ComponentOccurrences = oAsmCompDef.Occurrences

' Set a reference to a Component Occurrence
Dim oOcc As ComponentOccurrence = oOccurrences.ItemByName("Part1")

' Set a reference to the Part Component Definition (Occurrence)
Dim oPartCompDef As PartComponentDefinition = oOcc.Definition

' Set a reference to the Part Features (Occurrence)
Dim oPartFeatures As PartFeatures = oPartCompDef.Features

' Set a reference to the Rectangular Pattern Features (Occurrence)
Dim oRectangularPatternFeatures As RectangularPatternFeatures = oPartFeatures.RectangularPatternFeatures

' Set a reference to the Rectangular Pattern Features (Occurrence)
Dim oOccPattern_Dummy As RectangularPatternFeature = oRectangularPatternFeatures.Item("Pattern_Dummy")
Dim oOccPattern_Gaten As RectangularPatternFeature = oRectangularPatternFeatures.Item("Pattern_Gaten")

' Create Rectangular Pattern Feature Proxies
oOcc.CreateGeometryProxy(oOccPattern_Dummy, oOccPattern_Dummy_Proxy)
oOcc.CreateGeometryProxy(oOccPattern_Gaten, oOccPattern_Gaten_Proxy)

' Set a reference to the Occurrence Patterns
Dim oAsmPatterns As OccurrencePatterns = oAsmCompDef.OccurrencePatterns

' Set a reference to an Occurrence Pattern
Dim oAsmPattern_Gaten As FeatureBasedOccurrencePattern = oAsmPatterns.Item("Part2")

' Set to which Feature Patterns the Occurrence Patterns are linked
If Active = True Then
	oAsmPattern_Gaten.FeaturePattern = oOccPattern_Gaten_Proxy
Else
	oAsmPattern_Gaten.FeaturePattern = oOccPattern_Dummy_Proxy
End If

' Run Rule to set the BOM Structure Overrides
iLogicVb.RunRule("BOM Structure Overrides")