Pattern with assemblies view problem

Pattern with assemblies view problem

Anonymous
Not applicable
491 Views
3 Replies
Message 1 of 4

Pattern with assemblies view problem

Anonymous
Not applicable

Hi,

 

When i make a pattern with 4 assemblies all these assemblies are the default view. But when i raise the pattern number to 5 the assembly that is new is on view master.

 

Is it possible to set all the assemblies within this pattern to the same view (default)? I tried somthing but it doesnt work.

 

Dim asmDef = ThisDoc.Document.ComponentDefinition
Dim compPattern As OccurrencePattern
Dim compObj As ComponentOccurrence

compPattern = asmDef.OccurrencePatterns("Pattern - Clamp plates") 'Pattern name

For Each obj As Object In compPattern.ParentComponents
	obj.SetDesignViewRepresentation("Default", , True) 'View Default associative
Next

 

0 Likes
Accepted solutions (1)
492 Views
3 Replies
Replies (3)
Message 2 of 4

rjay75
Collaborator
Collaborator

Try

 

obj.SetDesignViewRepresentation("Default", Nothing, True) 'View Default associative
0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi,

 

Sorry for my late response & thank you for the help!

 

I tried adjusting this but still my views in the pattern are set to master.

 

Dim asmDef = ThisDoc.Document.ComponentDefinition
Dim compPattern As OccurrencePattern
Dim compObj As ComponentOccurrence

compPattern = asmDef.OccurrencePatterns("Pattern - Clamp plates") 'Pattern name

For Each obj As Object In compPattern.ParentComponents
	obj.SetDesignViewRepresentation("Default", Nothing, True) 'View Default associative
Next

 

It's really frustrating. There are alot of invisible parts that suddenly get visible, and that not good.

What can i do?

0 Likes
Message 4 of 4

rjay75
Collaborator
Collaborator
Accepted solution

Try this, (I can't test it at the moment but I think its what is happening.)

 

It looks like you're only chaning the repesentation on the originating components but not the newly add ones.

 

For Each obj As Object In compPattern.ParentComponents
	obj.SetDesignViewRepresentation("Default", Nothing, True) 'View Default associative
Next

 

Instead try this one. This will go over all elements (old and new).

 

For Each element As OccurrencePatternElement in compPattern.OccurrencePatternElements
For Each obj As Object In element.Occurrences obj.SetDesignViewRepresentation("Default", Nothing, True) 'View Default associative Next
Next
0 Likes