iLogic

iLogic

mohandis2
Advocate Advocate
645 Views
3 Replies
Message 1 of 4

iLogic

mohandis2
Advocate
Advocate

I have a more then 1500 parts assembly, these parts are driven from a big multi-body parts using "Make components" command, 

when I update the assembly, it takes hours, and my best way is to leave inventor working overnight,

or open individual parts, update, save and close every single one, which is a very long process. 

I'm looking for an iLogic that will update only selected parts within the assembly, see screenshot 

any help please?  

 

0 Likes
Accepted solutions (2)
646 Views
3 Replies
Replies (3)
Message 2 of 4

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

You can select the occurences you want to update and run this iLogic rule below. It's only with a few prechecks, so be please careful and test with a copy if possible.

If ThisDoc.Document.DocumentType IsNot DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("You need an assembly document to run this rule", , "iLogic error")
	Exit Sub
End If

Dim oAssDoc As AssemblyDocument = ThisDoc.Document
If oAssDoc.ComponentDefinition.Occurrences.Count = 0 Then
	MsgBox("No occurences to update ", , "iLogic error")
	Exit Sub
End If

If oAssDoc.SelectSet.Count = 0 Then
	MsgBox("Select at least one occurence before run this rule", , "iLogic error")
	Exit Sub
End If

Dim oObj As Object
For Each oObj In ThisDoc.Document.SelectSet
    If TypeOf oObj Is ComponentOccurrence Then
        Call oObj.ReferencedDocumentDescriptor.ReferencedDocument.Update
    End If
Next

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 4

Ralf_Krieg
Advisor
Advisor
Accepted solution

Sorry, made a mistake in line 1.

If Not ThisDoc.Document.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("You need an assembly document to run this rule", , "iLogic error")
	Exit Sub
End If

Dim oAssDoc As AssemblyDocument = ThisDoc.Document
If oAssDoc.ComponentDefinition.Occurrences.Count = 0 Then
	MsgBox("No occurences to update ", , "iLogic error")
	Exit Sub
End If

If oAssDoc.SelectSet.Count = 0 Then
	MsgBox("Select at least one occurence before run this rule", , "iLogic error")
	Exit Sub
End If

Dim oObj As Object
For Each oObj In ThisDoc.Document.SelectSet
    If TypeOf oObj Is ComponentOccurrence Then
        Call oObj.ReferencedDocumentDescriptor.ReferencedDocument.Update
    End If
Next

R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 4 of 4

mohandis2
Advocate
Advocate

worked great, thanks.

0 Likes