View Reps in assemblies as DEFAULT (not master)

View Reps in assemblies as DEFAULT (not master)

Winks87
Collaborator Collaborator
2,651 Views
7 Replies
Message 1 of 8

View Reps in assemblies as DEFAULT (not master)

Winks87
Collaborator
Collaborator

We use a lot of sketches to drive frame generator parts, in the sub assemblies, this works fine as the view rep is set to default (hides the sketches).  in a top level assembly, I have to go into each sub-assembly and hide the sketches, and I see the view rep is always set to master?  my check in is set to have last active on the view reps, this is a real time killer!  

 

Inventor 2019.4.5 build 330

James Winkler
0 Likes
Accepted solutions (1)
2,652 Views
7 Replies
Replies (7)
Message 2 of 8

jtylerbc
Mentor
Mentor
Accepted solution

In your top-level assembly, are you setting the subassemblies to use the Default representation, and setting it as associative?  Right-click on the subassembly and pick "Representation" to get to this dialog box.

 

View Rep Associativity.PNG

0 Likes
Message 3 of 8

Winks87
Collaborator
Collaborator

Is there a way to do this automatically?

James Winkler
0 Likes
Message 4 of 8

jtylerbc
Mentor
Mentor

First, let me say that I'm not a Vault user, so I can't speak to the way any of this interacts with Vault.  So, ignoring Vault, and doing some quick checking with some models to make sure I'm not speaking incorrectly from memory:

 

  • If you Place a component into an assembly, it places with the View Representation it was saved in active, and defaults to being Associative.
  • If you Copy and Paste a component from one assembly to another, it will paste the new copy with the same View Rep and Associative settings that the original had.  This can be different to the settings that were last saved in the component itself.

 

Based on those behaviors, it seems to me that either Vault throws in a quirk that I'm not aware of (since I don't use it), or you're checking it in with the "Master" rep active.  

 

Even if you do have to follow my suggestion manually, it would still be less work than what you are doing now.  Instead of having to hide each sketch individually in the subassembly (and probably go back to hide new ones if sketches are added later), you would just set the rep and associativity once for that instance and be done.

 

However, there is a chance that there is something Vault-related going wrong with your process that is causing this, and maybe a Vault user will come along that knows the answer to that part.  Another possibility would be an iLogic rule that you can run in your main assembly as a shortcut to quickly set all subassemblies to Default and Associative.

0 Likes
Message 5 of 8

Winks87
Collaborator
Collaborator

First of all, thank you for the detailed reply.  yes, setting the view rep to default is easier than delving into the file structure looking for sketches!  I will look at the Vault side of things to see if that is causing the issue.  I really don't ever use the Master view rep, that is what confused me as to why this gets set.  If I find anything I will post to forum, thanks again!

James Winkler
0 Likes
Message 6 of 8

jtylerbc
Mentor
Mentor

Here is some sample code for the iLogic method, in case you decide to go that route.  I would suggest making this an external rule, and just running it manually when you need to as a shortcut.

 

As written, this would set all components (both parts and assemblies) to their Default representation, with associativity turned on.  If you wanted it to only affect subassemblies and not parts, that could be done as well, but this example isn't quite that smart.  I quickly made this code from a rule I already had that sets all components to a View Rep called "Painted".  All I changed to mock up your scenario was the name of the View Rep.  So while I know that it should run properly, it doesn't do anything special that my original didn't.

 

Dim doc As AssemblyDocument = ThisDoc.Document
Dim cdef As ComponentDefinition = doc.ComponentDefinition
Dim occ As Inventor.ComponentOccurrence

For Each occ In cdef.Occurrences
	Try
	occ.SetDesignViewRepresentation("Default", True, True)
	Catch
	End Try
Next

 

At my company, we have two rules like this for setting up commonly-used View Representations.  The other one is a little more complicated, because it sets assemblies to one of two representations based on some If/Then logic, rather than making them all the same.  I used the simpler one to base my example on, both because it's easier to understand as a sample, and because it's closer to what I think you would want anyway.

Message 7 of 8

johnsonshiue
Community Manager
Community Manager

Hi! You may need to change File Open Default options. Go to Tools -> App Options -> File -> File Open Defaults -> select the file type and set Design View to Last Active.

Many thanks!



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

michael_janssenCN38L
Advocate
Advocate

Great code.

I need the same thing in an assembly to change the model states for all components.

We have 2 model states

"Primary" and "low"

 

Greeting Michael

0 Likes