Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with ilogic code

2 REPLIES 2
Reply
Message 1 of 3
itjelta
341 Views, 2 Replies

Help with ilogic code

I have asked this in another thread, and was recommended to start my own; so....starting a new thread:

 

 

Hi, thanks for all great codes and help provided here.

 

I have been browsing this forums for some time and picked up bits & pieces of knowledge and put it to, hopefully, good use 🙂

 

 

I am working on creating a configurator that can be used in a assembly for in.ex a HVAC Flange, that can be changed by using iLogic form with if/elseif and True/False etc.

 

I'm trying to work in the use if iLogic in my company, but I need to approach this slowly. So what I am trying to do is to combine what is already there with iLogic to improve the workflow for me, and my coworkers.

 

 

 

flange.jpg

 

But I have already "standard" assembly's with idw drawings ready for the Flanges

 

 

There is two solutions im working with:

 

I would like to add the possibility that when you choose one of the flanges, that the .idw file from the standard assembly will be opened (from outside project folder) and a pdf. will be generated and copied into my project folder with a new prefix in the filename.

 

in ex.

 

I have my iLogic configurator called:

L1234_000_Flange ø300.ipt

 

the .idw I want to copy from is named

 

_Flange ø300.idw

 

and I want the pdf to take the prefix on my configurator and add it to the pdf like this:

 

L1234_000_Flange ø300.pdf

 

and If i for some reason change the configurator it will delete the previous one and replace with new pdf

in.ex

 

L1234_000_Flange ø500.ipt

 

_Flange ø500.idw

 

to:

 

L1234_000_Flange ø500.pdf

 

 

The other solution would be to copy the Flange assembly with idw into my folder, rename it to my projects prefix. And then again delete it and insert the new if I choose another one from the configurator.

 

I am not using the copied flange assembly in my main assembly, I will use the configurator as a dummy that will show the actual size and appearance of the flange assembly. But I need to reference the "real" one.

 

 

The reason for this is simple: we often copy and reuse projects, but change different things like in this example, the flanges. And to avoid replacing the assembly, and cleaning up the drawings, I believe this could shave off some hrs for us. (We do this with many parts/assembly's in the projects, not only flanges)

 

I hope this is clear, English is not my native language, so I hope I didn't mess to much up in my explanation

 

 

This is the code I have, it could probably be made easier or shorter etc, but this is good enough for now.

 

FlangeType = Parameter("FlangeType")


'Type M0106782-A31-00
If FlangeType = "HVAC Flange Ø160 - ISO 15138" Then
Number="4"
Flange_H="124"
Innerdiameter_Flange="160"
Outerdiameter_FlangeLid="240"
HoleRadius="205"
HoleDia="10"
Top_Thickness="4"

'iProperties description:
ElseIf Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø160 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø160 - ISO 15138 - S355J2 "	
End If


'Type M0106782-A14-00
If FlangeType = "HVAC Flange Ø200 - ISO 15138" Then
Number="8"
Flange_H="124"
Innerdiameter_Flange="200"
Outerdiameter_FlangeLid="280"
HoleRadius="245"
HoleDia="10"
Top_Thickness="4"
End If

'iProperties description:
If Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø200 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø200 - ISO 15138 - S355J2 "	
End If


'Type M0106782-A09-00
If FlangeType = "HVAC Flange Ø250 - ISO 15138" Then
Number="12"
Flange_H="124"
Innerdiameter_Flange="250"
Outerdiameter_FlangeLid="330"
HoleRadius="295"
HoleDia="10"
Top_Thickness="4"
End If

'iProperties description:
If Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø250 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø250 - ISO 15138 - S355J2 "	
End If

'Type M0106782-A02-00
If FlangeType = "HVAC Flange Ø315 - ISO 15138" Then
Number="8"
Flange_H="124"
Innerdiameter_Flange="315"
Outerdiameter_FlangeLid="395"
HoleRadius="360"
HoleDia="10"
Top_Thickness="4"
End If

'iProperties description:
If Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø315 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø315 - ISO 15138 - S355J2 "	
End If


'Type M0106782-A19-00
If FlangeType = "HVAC Flange Ø400 - ISO 15138" Then
Number="12"
Flange_H="125"
Innerdiameter_Flange="400"
Outerdiameter_FlangeLid="500"
HoleRadius="459"
HoleDia="12"
Top_Thickness="5"
End If

'iProperties description:
If Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø400 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø400 - ISO 15138 - S355J2 "	
End If

'Type M0106782-A29-00
If FlangeType = "HVAC Flange Ø500 - ISO 15138" Then
Number="12"
Flange_H="125"
Innerdiameter_Flange="500"
Outerdiameter_FlangeLid="600"
HoleRadius="559"
HoleDia="10"
Top_Thickness="5"
End If

'iProperties description:
If Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø500 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø500 - ISO 15138 - S355J2 "	
End If


'Type M0106782-A21-00
If FlangeType = "HVAC Flange Ø630 - ISO 15138" Then
Number="16"
Flange_H="125"
Innerdiameter_Flange="630"
Outerdiameter_FlangeLid="730"
HoleRadius="689"
HoleDia="12"
Top_Thickness="5"
End If

'iProperties description:
If Material = "Stainless steel" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø630 - ISO 15138 - EN 1.4404 "
ElseIf Material = "Carbon" Then
iProperties.Value("Project", "Description") = "HVAC Flange Ø630 - ISO 15138 - S355J2 "	
End If

Dim oNode As BrowserNode
oNode = ThisApplication.ActiveDocument.BrowserPanes.ActivePane.TopNode
oNode.DoSelect


iLogicVb.UpdateWhenDone = True

 

 

also adding the configurator in attachments.

 

 

 

 

Reference thread:

 

http://forums.autodesk.com/t5/inventor-customization/ilogic-problem/td-p/5382071/page/2

2 REPLIES 2
Message 2 of 3
rossano_praderi
in reply to: itjelta

Nice work!

 

Which solution do you want to use?

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 3 of 3
itjelta
in reply to: rossano_praderi

Still working on this codes, and how to do the configurator the best way.

Im now testing assembly version of this code, combining with ilogic components. And that way its actually working great. I only need to update a bit on the drawings...but perhaps there is a way to automate that process too 🙂

 

But I am still interested in the second sollution I posted though 🙂

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

Post to forums  

Autodesk Design & Make Report