Making a particular View rep. active on open

Making a particular View rep. active on open

Anonymous
Not applicable
367 Views
3 Replies
Message 1 of 4

Making a particular View rep. active on open

Anonymous
Not applicable

Good Morning All!

  Hopefully this will be an easy question. I've made a series of assembly models containing iLogic rules to drive different configurations of these assemblies. When I open some of them, I find things that were suppressed at last save now showing. I have to immediately go to "Level of Detail" and reset it to "Custom" to get things to display correctly and to be able to use my iLogic form to modify the assembly. So my question is this: is there a way via iLogic, to set the "Level of Detail" to "Custom" automatically when I open the assembly model? Seems like it should be pretty straight forward to do.

   Thanks in advance for all and any suggestions. Hope everyone has a great Inventor day!

 

 

Frank

 

(did I just coin a new phrase?)

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

NSBowser
Advocate
Advocate

This code should do what your asking. You should be able to set up an iLogic Trigger on Document Open to run this rule.

 

Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument
If oDoc.DocumentType = 12291 Then
	Dim oAsmCompDef As AssemblyComponentDefinition
	oAsmCompDef = oDoc.ComponentDefinition
	oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations
	Try
		oViewRep = oViewReps.Item("Custom")
		oViewRep.Activate
	Catch
		'view rep doesn't exist... opps
	End Try
End If

Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes
Message 3 of 4

NSBowser
Advocate
Advocate
Accepted solution
Also, I just thought of this, you may want to just incorporate the task of setting the Design View to the 'Custom' Rep as the first few lines of code in your existing iLogic. Rather than forcing the task on all assemblies with abandon.

Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
0 Likes
Message 4 of 4

Anonymous
Not applicable

NSBowser,

    Thanks for the code. And yes, I will put it in the beginning of any of my assembly models that I am using iLogic to drive. Hope you have a great week.

 

 

Frank

0 Likes