Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I-Logic setting view

2 REPLIES 2
Reply
Message 1 of 3
deltades
355 Views, 2 Replies

I-Logic setting view

Hi,

I want to incorporate into my rules custom views that will change based on selections from a series of cases.

Looking through the system snippets I found that "Components" accomidates for visibility of a part but nothing I have found will allow for the selection of "View" to be changed from Master to a locked custom view.

In the model tab of the editor it shows View as being available and shows the current view that is selected but when I tried to "Capture Current State" it did nothing.

I want to do this because It would help prevent confusion when looking at the skeleton sketches that I have in this file for condition A... condition B... C and so on..

Is there some way I can do this?

Thanks in advance

 

2 REPLIES 2
Message 2 of 3
cwhetten
in reply to: deltades

If I understand your question correctly, then you will want one of the following segments of code.

 

For setting the view representation of the part or assembly which contains the rule:

 

Spoiler
oThisCompDef = ThisDoc.Document.ComponentDefinition

Select Case ViewRep
Case "Custom View Rep 1"
oThisCompDef.RepresentationsManager.DesignViewRepresentations.Item("CustomView1").Activate

Case "Custom View Rep 2"
oThisCompDef.RepresentationsManager.DesignViewRepresentations.Item("CustomView2").Activate

End Select

 

For setting the view rep of a component in an assembly:

 

Spoiler
oSubComp = ThisDoc.Document.ComponentDefinition.Occurrences.ItemByName("Component Name Here")

Select Case SubViewRep
Case "Sub-component View Rep 1"
oSubComp.SetDesignViewRepresentation("SubViewRep1", ,True) 'True for associative

Case "Sub-component View Rep 2"
oSubComp.SetDesignViewRepresentation("SubViewRep2", ,True)

End Select

 

I wrote this code to use two user-definded text parameters (ViewRep & SubViewRep).  These are multi-value parameters that can have the values seen in the cases.

 

See the attached assembly and part to see how it works.

 

Please click "Accept as Solution" if this response answers your question.

 

Cameron Whetten
Inventor 2012

Message 3 of 3
deltades
in reply to: cwhetten

Yes... I think this will do it but I need to figure out how I can incorporate it into my existing case structure or use is as a seperate rule and use if statements or something.

Thanks!

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report