iLogic for an entire assembly?

iLogic for an entire assembly?

WillL84
Collaborator Collaborator
601 Views
7 Replies
Message 1 of 8

iLogic for an entire assembly?

WillL84
Collaborator
Collaborator

Hi guys,

 I'm new to using iLogic but I' have implemented it on single parts in the past, for parts that are overall the same but have different parameters for things like hole diameter, etc.

 

I made an assembly yesterday and last night I was realizing that an iLogic setup would be great for changing parameters and making new parts. Currently it's setup with an Excel sheet linked to the parameters.

 

Is it possible to use iLogic for the entire assembly? For instance - could someone open the assembly and use an iLogic form to change parameters for each individual part like the current Excel sheet does? I've uploaded the Pack N Go files to my Google Drive (ZIP was too big and it's more than 3 files) for the assembly so you can see what I'm trying to do. Thanks in advance.

Windows 11 Pro 64-bit
Inventor 2025 (PDMC)
TITAN Computers C161
i7-11700K/32GB RAM/Quadro RTX A4000
0 Likes
Accepted solutions (1)
602 Views
7 Replies
Replies (7)
Message 2 of 8

A.Acheson
Mentor
Mentor

Hi @WillL84 

If you want to drive part files from the assembly. Create the driving parameters in the assembly. Add these to a form, and close. Open the ilogic tab, open the browser on the part and parameters you need and right click and add. Then go to the assemblys parameters and set them equal to parts parameters.

 

I would be in favour of not having an excel sheet within the parts as this would further complicated things and add another avenue for changes to be introduced.  

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 8

WillL84
Collaborator
Collaborator

Ok so I need to remove the sheet from each part and the assembly. Do I name the dimensions for each part (i.e. "width" or "length") the same for each part as well or does that not matter?

 

Ok I removed the Excel association, added forms to each part with the parameters and added forms to the main assembly. Now how do I set the assembly parameters to drive the part parameters?

Windows 11 Pro 64-bit
Inventor 2025 (PDMC)
TITAN Computers C161
i7-11700K/32GB RAM/Quadro RTX A4000
0 Likes
Message 4 of 8

A.Acheson
Mentor
Mentor
Accepted solution

See below images and the rule create by capturing the parameters.

Create the driving parameters in the assembly. Add these to a form, and close. Open the ilogic tab, open the browser on the part and parameters you need and right click and add. Then go to the assembly's parameters and set them equal to parts parameters.

AAcheson_0-1729095081380.png

Rule

Parameter("477557", "Length") = Length

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 5 of 8

WillL84
Collaborator
Collaborator

Ok so now how do I save this as a template?

 

Basically I want a user to be able to open the template assembly, change the parameters and then save the assembly and the included parts with unique file names, if possible.

Windows 11 Pro 64-bit
Inventor 2025 (PDMC)
TITAN Computers C161
i7-11700K/32GB RAM/Quadro RTX A4000
0 Likes
Message 6 of 8

A.Acheson
Mentor
Mentor

Hi @WillL84 

 

I think you will need to use the ilogic Place Component Function in Inventor to create a unique ilogic assembly. You won't be able to do this automatically from a manual template.

AAcheson_1-1729105247119.png

 

 

 

The first thing you need to do is to stabilize the occurrence name so the code sees a static reference rather than a name that changes with every part rename. 

 

AAcheson_0-1729105068965.png

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 7 of 8

marcin_otręba
Advisor
Advisor

Hi,

 

I would recommend a more flexible approach that can be used every time, regardless of the number of parameters and the complexity of the assembly.

i commented some options like using expression instead value, and creating parameter if it is missing.

It is adapted from here: Solved: Copy user parameters from assembly to parts - Autodesk Community - Inventor

If ThisDoc.Document.DocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
    Dim asmDoc As Inventor.AssemblyDocument = ThisDoc.Document	
    For Each refDoc As Inventor.Document In asmDoc.AllReferencedDocuments
        ' Look for part documents.
        If refDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then
            Dim partDoc As Inventor.PartDocument = refDoc
            Dim refDocUserParams As UserParameters = partDoc.ComponentDefinition.Parameters.UserParameters

            ' Add the assembly parameters to the part.
            For Each asmUserParam As UserParameter In asmDoc.ComponentDefinition.Parameters.UserParameters
                ' Check to see if the parameter already exists.
                Dim checkParam As UserParameter = Nothing
                Try
                    checkParam = refDocUserParams.Item(asmUserParam.Name)
                Catch ex As Exception
                    checkParam = Nothing
                End Try

                If checkParam Is Nothing Then
                    ' Create the missing parameter.
					'refDocUserParams.AddByvalue(asmUserParam.Name, asmUserParam.Value, asmUserParam.Units)
                   ' refDocUserParams.AddByExpression(asmUserParam.Name, asmUserParam.Expression, asmUserParam.Units)
                Else
                    ' Update the value of the existing parameter.
					checkParam.Expression = asmUserParam.Expression
                    'checkParam.Expression = asmUserParam.Expression
					
                End If
            Next
        End If
    Next
End If

 

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 8 of 8

WillL84
Collaborator
Collaborator

That looks way beyond my level lol. I have no idea where to even start with that.

Windows 11 Pro 64-bit
Inventor 2025 (PDMC)
TITAN Computers C161
i7-11700K/32GB RAM/Quadro RTX A4000
0 Likes