Link between Level of Detail and Positional representation via ilogic

Link between Level of Detail and Positional representation via ilogic

Anonymous
Not applicable
672 Views
2 Replies
Message 1 of 3

Link between Level of Detail and Positional representation via ilogic

Anonymous
Not applicable

Hi,

I have made Rule to link LOD and Positional representation and its working fine. But problem is every time I have to run the Rule manually even I have set 'Event Triggers' but rule is not running automatically. My Requirement is when I change LOD, as per Rule Positional representation should change/update accordingly & automatically. Any Solutions??

 

Rule:

 

SyntaxEditor Code Snippet

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name = "Master" Then
oAsmCompDef.RepresentationsManager.PositionalRepresentations.Item("Master").activate

Else If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name = "437.5" Then
oAsmCompDef.RepresentationsManager.PositionalRepresentations.Item("437.5").activate

Else If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name = "762" Then
oAsmCompDef.RepresentationsManager.PositionalRepresentations.Item("762").activate
End If

 

0 Likes
673 Views
2 Replies
Replies (2)
Message 2 of 3

andrewiv
Advisor
Advisor

I think you have it set to the wrong event trigger.  When you change levels of detail it isn't changing any model parameters.  Assuming that you have something suppressed in the level of detail, I think that the Component Suppression Change is the correct trigger to use.

Andrew In’t Veld
Designer / CAD Administrator

0 Likes
Message 3 of 3

MechMachineMan
Advisor
Advisor

Or you can use the representation events...

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-6D057DA7-44D8-4CC6-ABAE-866F03011085

 

The only issue is you would need to add a class module that fires on startup (or on an event trigger like OpenDocument) that would start the RepresentationEvents tracking so that you can properly enable the event - or some similar method to get it working.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes