Anonymous
455 Views, 1 Reply
04-01-2021
02:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-01-2021
02:12 AM
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?
Solved! Go to Solution.
04-01-2021
07:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-01-2021
07:27 PM
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
Or if this helped you, please, click (like)
Regards
Alan