iLogic View Representation update problem

iLogic View Representation update problem

Anonymous
Not applicable
478 Views
1 Reply
Message 1 of 2

iLogic View Representation update problem

Anonymous
Not applicable

Hi,

I have a created simple rule:

oViewRep = ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager.ActiveDesignViewRepresentation.Name
If oViewRep = "open" Then
		d21 = "840"
		d32 = "180"
	Else
		d21 = "0"
		d32 = "0"
End If

RuleParametersOutput()
InventorVb.DocumentUpdate() 

 It work's fine but not triggered, when i change view representation in model view. Any ideas?

0 Likes
Accepted solutions (1)
479 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor
Accepted solution

I have assumed your are running this in a local rule. The issue here seems to be the event trigger for the rule. The view rep when changed manually isn't triggering the rule to run.

 

To change this behavior. I had to create a parameter for the view rep and place into a form(optional) When the ViewRep parameter value is changed the rule is triggered  and the active view rep is changed. Then the conditional statement runs. The attached assembly shows this working.

'' set a reference to the assembly component definintion.
'' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'define view rep collection
Dim oViewReps As DesignViewRepresentations
oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations

'define view rep 
Dim oViewRep As DesignViewRepresentation
oViewRep = oAsmCompDef.RepresentationsManager.ActiveDesignViewRepresentation

Dim oViewRepName As String
oViewRepName = oViewRep.Name

'Activate  viewrep via parameter selected 
oViewReps.Item(ViewRep).Activate

'check names
If oViewRepName = "open" Then
		d21 = "840"
		d32 = "180"
Else
		d21 = "0"
		d32 = "0"
End If

'RuleParametersOutput()
'InventorVb.DocumentUpdate()

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes