Update (Replace / Manage) assembly parts as per excel parameters

Update (Replace / Manage) assembly parts as per excel parameters

s.barge
Participant Participant
423 Views
5 Replies
Message 1 of 6

Update (Replace / Manage) assembly parts as per excel parameters

s.barge
Participant
Participant

Hello, Greetings for the day!!

 

I am working on an assembly which is driven by excel parameters & iLogic rule. I am using Audtodesk Inventor Professional 2022. 

My requirement is to update the attachd image numbered parts as per Length parameter from excel. I have created different standard lengths modules to suit this assembly length.

Length concern assemblyLength concern assemblyLength variations exampleLength variations exampleiLogic rule for different lengthsiLogic rule for different lengthsAssemblyiLogic1.png

 

       I stucked at replacing or listing assembly sequence of the parts as per attached data sheet i.e If I need assembly length of 6000 then Inventor should be placed components as per respected assembly sequence and quantities.

 

Somewhere I managed to do it through iLogic code like attached snaps, here whenever I change length parameter and run the code it takes long time to build the assembly. I have 15 to 20 variations for configuration which seems hard task to perform by this method.

Is there any provision in iLogic rule to run the specific part of the rule as per required assemly operations?

by doing this loading time may be reduced.

               

Is there any other methods to perform this assembly automation.

I need some smooth / exact way to address this whole operations.

 

I strongly believe in iLogic function can be survive me in this situation, But can't find out exact way to move ahead.

I would greatly appreciate it if you kindly give me some feedback on this.

0 Likes
Accepted solutions (1)
424 Views
5 Replies
Replies (5)
Message 2 of 6

TechInventor20
Advocate
Advocate

You mean like this?

 

Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oComps As ComponentOccurrences = oDoc.ComponentDefinition.Occurrences

For Each oComp As ComponentOccurrence In oComps 'Alle componenten dooorlopen

Dim Datasheet as string = "Your data sheet"
Dim Sheet as string = "Your sheet name"

For Rowvalue = 1 to 20

Dim Name as string = GoExcel.CellValue(Datasheet, Sheet, "A" & Rowvalue)


If oComp.Name.Contains(Name) Then
Parameter(oComp.Name, GoExcel.CellValue(Datasheet, Sheet, "B" & Rowvalue))
end if

Next
Next

 

0 Likes
Message 3 of 6

s.barge
Participant
Participant

Hello TechInventor20, Thank you for your reply on the topic. I think I did't described the issue clearly. Retrying to explain it in header discussion.

 

 

0 Likes
Message 4 of 6

TechInventor20
Advocate
Advocate
Accepted solution

-I had the same problem as you. What i did is split all the different parts of the ilogic code in to different ilogic codes. This way i can run multiple rules two or three times if nessesarry.

Maybe you could try the code below. This is how I change some of my "standard parts" in my automatic assembly builder.


Bodem_0punt = GoExcel.CellValue(Datasheet, Blad, "O" & Part_hight)
' MsgBox(Bodem_0punt & " 2 " & Romp_aantal)
'get user input - units are cm

oX = 0
oY = 0
oZ = Bodem_0punt
'placement co-ordinates in mm's
oMatrix.SetTranslation(oTG.CreateVector(oX/10, oY/10, oZ/10))
oOccurrence = oAsmCompDef.Occurrences.Add(Part_name, oMatrix)
oOccurrence.Grounded = True

But before putting in a part you have to check if it allready is in de assembly. if it is, delete it.
The answer on "Are there any provision in ilogic rule to run the specific part of the rule as per required assembly operations" then i'm thinking of then

GoTo Thispartoftherule

'some code between

Thispartoftherule:
'your code
Message 5 of 6

s.barge
Participant
Participant

Hello  TechInventor20, Thanks for your reply. I will try it.

Thanks again for your efforts and time.

0 Likes
Message 6 of 6

TechInventor20
Advocate
Advocate

This is how it looks in my assembly

 

TechInventor20_0-1662969211416.png

 

"Rule0" is the rule that runs every other rule, and rules inside some of the parts/assembly's.

 

0 Likes