Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with iLogic

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
n00kie.tdc
899 Views, 17 Replies

Help with iLogic

Dear INVENTOR users,

I have such a question:

I am building a heat exchanger iLogic part.

So there are different types of heat exchangers. I am doing only SWEP (company name) heat exchangers.

So in SWEP they have several types of heat exchangers:

IC5

IC8

IC10

IC15

IC16

IC25

IC28

IC35

IC45

IC50

IC56

IC120

and some other heat exchangers.

Different types have different outer dimensions and connection sizes.

I set in USER PARAMETERS HE_TYPE and list all of these heat exchangers ... then I create a rule to control dimensions according to the type that I am using. That is not a problem.

 

But Heat exchangers can vary in manner of NUMBER OF PLATES. The bigger number of plates the thicker the ehat exchanger is. Thickness of HE is controlled by the formula. Each HE type has his own formula to control the thickness.

So here comes the problem. I list all possible number of plates in USER PARAMETER 1-250 plates. Then I created formula for each HE type and wrote it 250 times for each HE type.

 

So by the rule in ilogic it should be when I choose HE type it changes outer dimensions (it does that) and when I change number of plates it has to be changed a swell, but changed according to the HE type. But it doesn't do that. it doesn't change the thickness according to the formula. And I have no idea why.

 

Probably i write functions in Ilogic rule in a wrong way. for example I have this:

 

 

 

If HE_type="IC5" Then

HE_length = 192 mm

HE_width = 73 mm

Connections_point_out = 20.1 mm

Connection_length = 154 mm

Connection_width = 40 mm

HE_radius = 15 mm

Connection_size = 26.9 mm

 

End If

 

If HE_type="IC5"

 

 

Else If Number_of_plates= "1" Then                                         

d2= 7+2+2.24*(1-2)   

                                           

ElseIf Number_of_plates= "2" Then                                          

d2= 7+2+2.24*(2-2)                                   

                                           

ElseIf Number_of_plates= "3" Then                                          

d2= 7+2+2.24*(3-2)                                   

                                           

ElseIf Number_of_plates= "4" Then                                          

d2= 7+2+2.24*(4-2)          

 

and there are 250 such formulas......

 

I guess I wrote it somehow wrong ... can anybody suggest ?

I also attached file to this topic, so you can see the full picture of what I've done. 

     



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
17 REPLIES 17
Message 2 of 18
mrattray
in reply to: n00kie.tdc

Your using ElseIf wrong. ElseIf means if the preceding If statement is false and the following statement is true.

 

It should be something like:

 

If HE_type = "IC5" Then

If Number_of_plates = 1 Then

d2 = .....

ElseIf Number_of_plates = 2 Then

d2 = .....

End If

ElseIf HE_type = "IC6" Then

If Number_of_plates = 1 Then

d2 = ...

ElseIf Number_of_plates = 2 Then

d2 = ....

End If

End If

Mike (not Matt) Rattray

Message 3 of 18
coreyparks
in reply to: n00kie.tdc

try something like this, I think it's what your looking for.

 

If HE_type="IC5" Then
HE_length = 192 mm
HE_width = 73 mm
Connections_point_out = 20.1 mm
Connection_length = 154 mm
Connection_width = 40 mm
HE_radius = 15 mm
Connection_size = 26.9 mm

 

d2= 7+2+2.24*(Number_of_plates-2) 
  
End If


If HE_type="IC15" Then
HE_length = 465 mm
HE_width = 72 mm
Connections_point_out = 20.1 mm
Connection_length = 432 mm
Connection_width = 40 mm
HE_radius = 15 mm
Connection_size = 26.9 mm

 

d2= 4.3+2.24*Number_of_plates 

 

End If

 


 

Please mark this response "Accept as solution" if it answers your question.
-------------------------------------------------------------------------------------
Corey Parks
Message 4 of 18
coreyparks
in reply to: coreyparks

Also take a look at the part I attached.  I changed the number of plates to a number entry as that is so much easier than looking through that huge list.  I set it in ilogic to only allow between 10-250 plates using the parameter wizard.  Maybe this would work better for you?  Simpler and easier to set up anyway.

Please mark this response "Accept as solution" if it answers your question.
-------------------------------------------------------------------------------------
Corey Parks
Message 5 of 18
n00kie.tdc
in reply to: coreyparks

Thank you very much!

I will try to see this one tomorrow, it is an end of a working day.

Thank you very much for helping!!! Will try to post tomorrow if that was the thing I needed. But from first view it looks way better than my, code is ALOOOOOOOT smaller and easier to browse. I jsut hope this one will work out. Otherwise it is pain in the **** to change something in excel all the time. 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 6 of 18
mrattray
in reply to: coreyparks

Corey has the right solution here, I didn't really look at what you were trying to do with the formulas.

Mike (not Matt) Rattray

Message 7 of 18
n00kie.tdc
in reply to: coreyparks

Thank you very much, Corey!

Yes indeed that is right solution, I just finished the code now it is working perfectly.

Need to get deeper into that iLogic thingy, very useful, but sometimes breaks my brains 😃

Thank you very much and have a great day! 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 8 of 18
n00kie.tdc
in reply to: n00kie.tdc

It is finally working! But there is one more question. I'm trying to make an iPart of it to add it to the content library. But in parameter list I can't choose the type of the heat exchanger only the number of plates. Don't know how to complete that thing.

I attached a file with a complete iLogic, maybe someboy could suggest how to make HE_TYPE to appear in iPart option?

 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 9 of 18
n00kie.tdc
in reply to: n00kie.tdc

Ok I found out how to do that. I guess now I am all set to go. Just will struggle a bit with Descriptions and stuff like that.

Want to make so when I am choosing one of the HE types it will make a part name like it and in Description will write number of plates. He TYPE already works ... now need to find out how to do that with DESCRIPTION. 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 10 of 18
n00kie.tdc
in reply to: n00kie.tdc

Ok,

Now I am struggling with that Description thing.

 

What I want is to when I am placing Heat exchanger from the content Center Library so I will choose what kind of HE_TYPE I want to place from that it should ask me how many plates should it make. - I did all of that.

 

But I also want it when I'm placing the Heat Exchnager, i want it in iProperties to set PART NUMBER as heat exchanger type (for example it shoudl write part Number as SWEP IC5 or SWEP IC15 or any other type), But in another hand I want when I take the part out of the library, I want it to be saved as Part number- Number of plates. (For example part file should be named like this: SWEP IC5- 64plates)

And in iProperties I want number of plates to be written in Description. So all in all should look like this:

File name example: SWEP IC5- 43 plates
in iProperties Part Number: Swep IC5

in iProperties Description: 43 plates

 

I attached a file, final version of what I have done so far. 

 

Can somebody help me doing that ? Thank you very much for spending time. I am learning a lot from this. 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 11 of 18
mrattray
in reply to: n00kie.tdc

That's very easy to do from iLogic. Your code will look something like:

 

iProperties.Value("Project", "Part Number") = "SWEP " & HE_TYPE

iProperties.Value("Project", "Description") = numberOfPlates & " plates"

 

 

Replace numberOfPlates with whatever parameter your using to hold that value.

 

Try playing around with the snippets. They're useful.

Mike (not Matt) Rattray

Message 12 of 18
n00kie.tdc
in reply to: mrattray

Thanks 😃

I was doing the same, but I don't know why it didn't worked. Seriously. With this code it does work. I am quiet newbie in iLogic. How is it possible to leave a space between words? For examle:

 

iProperties.Value("Project", "Part Number")="SWEP"&HE_type

iProperties.Value("Project", "Description")=Number_of_plates&"Plates"

 

In this case in iProperties it just writes SWEPIC5 - without any spaces between words SWEP and IC5. What sign gives a space between words? The same with Number of plates 😃

 

And still haven't found out how to make so when I am placing the Heat exchanger in the assembly from the content center and it asks me save the file, so it will save it in a way of SWEP IC5- 47 Plates. i will try to play around =))

 

Thank you very much for helping! 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 13 of 18
n00kie.tdc
in reply to: n00kie.tdc

I found out, sorry i slightly changed your code form the beginning. Just deleted the space =)))

Now I found out. =D sorry for confusing =DDD

 

Only one question left. The file naming =D 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 14 of 18
n00kie.tdc
in reply to: n00kie.tdc

I found out one more problem now.

 

 I made an iPart and it looks like this:

1.JPG

 

And then I am adding my part to the Content Center. When i choose parameters that will be flexible (to choose) I choose Number_of_plates (this is from iLogic) BUT I don't have parameter HE_type. So I choose another Parameter from iPart table- Member. And also add Number_of_plates. So in total two parameters are KEY.

2.JPG 

 

When I add a part to assembly from Content Center it shows me all the data as it should:

 

3.JPG

 

But when I add the part no matter which of HE_type do I choose it still makes the Heat Exchanger with sizes of IC5, BUT Number_of_plates seem to work perfectly.

 

Any suggestions how this can be solved?

As I understood when I am publishing the part I should choose HE-type as a main parameter for Content Center, but there is no such thing. How can I do that another way? Or maybe I should make column in a table of iPart as CUSTOM? 

 

 

but the funniest thing that FILE NAMING is working now... that's weird =D 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 15 of 18
mrattray
in reply to: n00kie.tdc

I'm not familiar with content center, I don't use it.

I don't think you really want to use iParts. I've always had problems trying to use iParts with iLogic in them. It's like they don't get along. Maybe there's too many i's...

I would simply make a form for the heat exchanger with a "trigger" rule that brings the form up on the place component event. This way you simply place the part like any other part and when you do it brings up a form where you can select from a list your type and type in the number of plates.

Mike (not Matt) Rattray

Message 16 of 18
n00kie.tdc
in reply to: mrattray

Well, it could be the solution, but I would really loved to create a Content Center library with all the parts our Company is using in assemblies. And make it as simple as possible. So whenever you take a heat exchanger from Content Center it will be created by simply choosing correct heat exchanger and number of plates.

But in your case I would need to have this original file somewhere in specific directory and then copy it all the time to a new project folders, agree that it is not hard deal, but still, would like to struggle with ilogic. 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit
Message 17 of 18
mrattray
in reply to: n00kie.tdc

OK, I think the problem is with using a text parameter. I added a numeric user parameter and set it key assigning to it the same value in each row as your IC number.

Mike (not Matt) Rattray

Message 18 of 18
n00kie.tdc
in reply to: mrattray

i don't think that it is the problem. Well at least for me it didn't work.

The part seem to changhe ok when it is just a part and I change between parameters within the table. But then I place this part into the content center library and here starts the problem. Though i have different Heat Exchanger types, i choose one or another they all appear as they all have the same size. No matter if I choose IC5 or IC120 they are the same size when I take them from Content Center.

I don't know but it looks like the FAMILY table has absolutely nothing to do with sizes, and that is so weird. 



Autodesk Inventor 2019
Running on Dell Precision 7720 laptop:
Core i7 6820HQ
16 GB RAM
Quadro P3000
Widnows 7 PRO, 64-bit

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

Post to forums  

Autodesk Design & Make Report