Forms/ iLogic

Forms/ iLogic

PumaBH
Contributor Contributor
561 Views
9 Replies
Message 1 of 10

Forms/ iLogic

PumaBH
Contributor
Contributor

Hello All, 

 

Looking for a little bit of help with a standard model:

 

it consists of 8 corner pieces and a number of box section parts that change in length given the overall unit size.

 

Width = 2100mm

Height = 1600mm

length = 800mm

Hinge Door Opening = 400mm

fixed access panel = 250mm

 

These dimensions will generally change upon application. But the construction will always be the same. with the 50mm box section and corners. 

 

I'm looking for help regarding specific forms/iLogic/Rules that i can use to generate different size assemblies where i can modify the specs creating various assemblies quickly. 

 

 

image.png

 

Kind Regards, 

 

Ben 

0 Likes
562 Views
9 Replies
Replies (9)
Message 2 of 10

kacper.suchomski
Mentor
Mentor

Look this video:

https://youtu.be/aPph2AYHxN4

 


Kacper Suchomski

EESignature


YouTube - Inventor tutorials | LinkedIn | Instagram

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 3 of 10

A.Acheson
Mentor
Mentor

Can you give a little more info as to how you have currently constructed the model? Is it currently an assembly? Can you share a very simple file set of the .ipt and .iam that make up the assembly? Ensure to use pack and go and you can attach as a zip compressed folder.  Use squares and circles or remove confidential detail if your actually assembly is not shareable as is. Without knowing your current approach there is multiple routes that can be taken. 

 

Depending on how you approach this you can use as little ilogic or as much as you want. Is there any skeletal model controlling the frame size? 

 

There is a dedicated forum for ilogic questions here but this might be a good place for now where you can get advice on modelling techniques from the experts with or without ilogic. 

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

PumaBH
Contributor
Contributor

Hi Alan, 

 

yes, as shown below. the frame is constructed using a 3D sketch and frame generator. 

the box section profiles are not standard and i have added these via the author feature and used frame generator to assemble them. the corner pieces are added to my content center and assemble via iMates flush outside faces with the box section. The 2 of center posts are also frame generator. offset from the 3D sketch. 

 

in terms of iLogic, i would like to set this up to be modified quickly in terms of the 3 main outside dimensions @ 2100mm, 1600mm, and 800mm. Further to this the previous image i sent has panels assembled. i assume i'd be able to use iLogic so that when the main outside dimensions change the panel sizes change accordingly. 

 

image.png

 

Kind Regards, 

 

Ben 

 

 

0 Likes
Message 5 of 10

A.Acheson
Mentor
Mentor

Hi Ben,

Thanks for the additional info a little easier to see what you have. Can you replace the key dimensions with user parameters? If so you can then either drive them directly through the form or indirectly if parameters are in a different part such as your sheetmetal parts or master sketch part. You should be able to find the parameters in the ilogic editor then add and drive all the measurements if you want to group by model type etc. 

 

AAcheson_0-1680122495215.png

 

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

PumaBH
Contributor
Contributor

Hello,

 

So i've revisited this recently with spare time. 

 

i have set up a configuration form based on the user parameters which drives the 3D sketch overall size dimensions. 

 

and have a set parameter rule when i want to run the changes applied in the form. 

 

benWBWZL_0-1680694081805.png

 

the code for the set parameter rule is here: 

 

Public Sub Main()

	CopyUserParams()

End Sub



Private Sub CopyUserParams()

    If ThisDoc.Document.DocumentType <> Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then

        MsgBox("The active document must be an assembly.")

        Return

    End If



    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.AddByExpression(asmUserParam.Name, asmUserParam.Expression, asmUserParam.Units)

                Else

                    ' Update the value of the existing parameter.

                    checkParam.Expression = asmUserParam.Expression

                End If

            Next

        End If

    Next

	

	

	iLogicVb.UpdateWhenDone = True



End Sub

However, this all works well prior to the frame generator feature being used. the form does exactly what i require.

after i have used frame generator the form does not work and displays an error. I'm assuming it's because the frame generated parts are the issue as the form works with these parts suppressed.

 

is there a iLogic rule i can use to update the frame members once or during the set parameters rule is run? 

 

The assembly is attached in a .zip file which contains the frame generated members in a file and the 3D sketch.  

 

Kind Regards, 

 

Ben 

0 Likes
Message 7 of 10

PumaBH
Contributor
Contributor
i forgot to mention: i can suppress the frame generated parts and run the form/rules to change the overall size and then un-suppress the frame generated parts and rebuild the model for the members to change to the correct length.
0 Likes
Message 8 of 10

PumaBH
Contributor
Contributor

benWBWZL_0-1680695080871.png

benWBWZL_1-1680695111961.png

 

 

 

0 Likes
Message 9 of 10

A.Acheson
Mentor
Mentor

You will likely need a update snippet for the assembly and possibly a rebuild all. If you carry out the task without code can you write down the exact sequence of events you do? This includes entering into documents, hitting update and or rebuild all. 

See help file for assembly update and Assembly Rebuild 

You will find the same for the PartDocument. Changing the parameters of the sketch will likely need a part update to happen. 

 

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

PumaBH
Contributor
Contributor

Without code i'd simply edit the 3D sketch part and update the overall dimensions. return back to the assembly. and use the rebuild all button in the manage tab. the frame generated assembly would then rebuild and suit the 3D sketch modifications. 

 

in theory i'd like to use the form for dimension changes to the 3D sketch then when i use the set parameters button on the form it updates the sketch and rebuilds the frame generated parts to suit the 3D sketch dimensions. 

 

i know i need:

 

ThisDoc.Document.Rebuild()

 

and maybe i need this code? 

 

If Suppress="Yes" Then

Component.IsActive("Part_name")=True

ElseIf Suppress="No" Then

Component.IsActive("Part_name")=False End If

 

but i can't work out how to implement it in the set parameters code i have shared before

0 Likes