Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Subassemblies won't update unless in their own environment.

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
GavoGarmo
2096 Views, 7 Replies

iLogic Subassemblies won't update unless in their own environment.

I have an assembly which is made with a sub assembly. The sub assembly has iLogic code that both resizes it's parts and suppresses parts that arn't needed after a change in length.

 
If I open the sub assembly in it's own environment, the rule runs and it assumes the correct size and configuration, based on the parameters passed to it from the top level assembly.
 
However if I don't open the sub assembly into it's own environment, the parameters are successfully passed on, but the rule doesn't run and the sub assembly stays the wrong length.
 
I've tried all the kinds of document update I know, but nothing is working.
 
 
Hope someone can help 🙂
 
Cheers
 
GavoGarmo
7 REPLIES 7
Message 2 of 8
LewisLusby
in reply to: GavoGarmo

@ GavoGarmo

 

Maybe not what you're looking for but I used iLogic to control the top level assembly which passes parameters down from GA to parts and GA to subs to parts by adding a "Link Parameters" Rule to the GA and each sub.

 

Hope that helps

 

LL

Message 3 of 8
GavoGarmo
in reply to: LewisLusby

Hi Lewis,

 

Thanks for the reply, but the parameters are linking up OK, and being passed across at the right time. The problem is getting the assembly to update after the parameters have been passed across. I think I might have worked it out though and will get to try a solution this morning. If it works I'll repost with details of what I did.

 

Cheers

 

GavoGarmo

Message 4 of 8
LewisLusby
in reply to: GavoGarmo

I had a similar problem. Try the rebuild command in a main assembly rule, worked for me.

 

ThisApplication.ActiveDocument.Rebuild2 (True)

 

Good Luck

LL

Message 5 of 8
GavoGarmo
in reply to: LewisLusby

Thanks again Lewis, but it doesn't seem like anything's going to work!  I can't even get the forum site to upload my code so people could take a look. I'm doomed! 🙂

Message 6 of 8
GavoGarmo
in reply to: GavoGarmo

Fixed it. But I don't think it's a problem many other people would have. We started using the following snippet to "lock" the LOD as (iLogic). We don't intend to use LOD's for their main function, but instead just want to utilise iLogic suppression within our assemblies.

 

 

'Keeps LOD as "iLogic"
Dim CurrentDoc as AssemblyDocument = ThisDoc.Document 
If (Not (CurrentDoc Is ThisApplication.ActiveDocument)) Then Return

Dim doc as AssemblyDocument = ThisDoc.Document
'If doc.ComponentDefinition.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name <> "iLogic" Then

Dim oLOD As LevelOfDetailRepresentation 
Dim oAsmCompDef As ComponentDefinition 
oAsmCompDef = doc.ComponentDefinition
 Try
  oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
  Catch
  Dim nLOD As LevelOfDetailRepresentation
  nLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Add("iLogic")
  oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
 End Try

End If

 

The line in Red was the problem. Commented it out and now the assemblies work fine.

 

This might help someone as I got the snippet from the forum, and I doubt I'm the only person that used it.

 

Thanks again to anyone who had a ponder on my behalf.

 

Gavo Garmo

 

 

Message 7 of 8

I got the sme problem, and your iogic in this postimg helped me. Then I deleted this iLogic and the iLogic rule and the LOD created in the assembly. But, to my surprise, the the assebly is still doing well.

 

Thanks a lot.

 

Roy Wickrama

Message 8 of 8

Today, I also got the same problem. Your ilogic in this postimg helped me. Then I deleted the iLogic created in the assembly and deleted the ilogic LOD (created in the assembly by ilogic itself) as well. But, to my surprise, the the assebly keepd doing well repeatedly.

 

Thanks a lot.

 

Roy Wickrama

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

Post to forums  

Autodesk Design & Make Report