iLogic code to synchronize view rep. with pos. rep of same name.

iLogic code to synchronize view rep. with pos. rep of same name.

Anonymous
Not applicable
558 Views
6 Replies
Message 1 of 7

iLogic code to synchronize view rep. with pos. rep of same name.

Anonymous
Not applicable

I found some code on this forum that works very well on a small test assembly. 

When I use it on my larger target assembly it does not work under an iLogic trigger.

It does, however, work when the rule is run explicitly from the ilogic browser.

I have tried saving the rule under a new name directly in the assembly. It did not work, but I can run it explicitly and it works.

Any ideas?

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

If oAsmCompDef.RepresentationsManager.ActivePositionalRepresentation.Name = "Master"Then
'If the pos rep is the Master then activate the Default view rep
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Default").Activate
Else
Try
'Try to active a view rep with the same name as the active pos rep
'So if "two" is the current pos rep it will try to active the View rep "two"
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item(oAsmCompDef.RepresentationsManager.ActivePositionalRepresentation.Name).Activate
Catch
'If a view rep with the same name as the active pos rep doesn't exist set the default view rep active
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Default").Activate
End Try
End If

0 Likes
559 Views
6 Replies
Replies (6)
Message 2 of 7

Mark.Lancaster
Consultant
Consultant

@Anonymous

 

Programming questions and issues for Inventor need to be raised in the Inventor Customization forum.  I will have the moderator relocate it there to better suit your needs.

 

https://forums.autodesk.com/t5/inventor-customization/bd-p/120

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thnx

0 Likes
Message 4 of 7

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Can you please specify event trigger which is not working? Also please provide large assembly to test?

 

Please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 7

Anonymous
Not applicable

I have tried

This document: Trigger on any model parameter change

Assemblies: Any model parameter change

 

The assembly is very large 9397kb

 

 

0 Likes
Message 6 of 7

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Without Assembly file, unable to identify the root cause of issue. If assembly file is there, we can identify issue and suggestion can be given.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 7 of 7

Anonymous
Not applicable

Packngo is 200meg

Going to need an FTP site

0 Likes