Ilogic - Load and Unload with code

Ilogic - Load and Unload with code

Anonymous
Not applicable
610 Views
2 Replies
Message 1 of 3

Ilogic - Load and Unload with code

Anonymous
Not applicable

Good Day,

 

I have designed a belt conveyor generator with Inventor ilogic,  I would also like to design a bucket elevator generator.

 

I would like to switch between the two generators on the fly with ilogic code.

 

The belt conveyor generator has all of its internal rules embedded in the assembly.  I would not like to run both conveyors on one assembly but keep them separate in their respective .iam files.

 

Would it be possible to switch from the belt conveyor generator assembly to the bucket elevator generator assembly with code.  In other words, unload the the first assembly and load the new assembly without having to do it manually?  

 

In future I would like to add a screw conveyor assembly so I would like to have some sort of drop down list with the various conveyors and be able to switch between any of them with a single click.

 

Is this possible?  

0 Likes
Accepted solutions (1)
611 Views
2 Replies
Replies (2)
Message 2 of 3

bhavik4244
Collaborator
Collaborator

@Anonymous 

 

If I correctly understand your question, you should make a top assembly and insert both assemblies and use LOD or view rep and control it thru the parameters.

 

I had the same sort of situation when I did conveyor for normal condition and cleaning condition which I achieved thru LODs and View rep.


Bhavik Suthar
Message 3 of 3

alexanderboogaard
Enthusiast
Enthusiast
Accepted solution

Hi @Anonymous,

 

You could start an empty assembly file and add a multivalue text parameter (Conveyortype) with the different conveyor names, i.e. 

  • Belt
  • Bucket
  • Screw

Save that as a template.

 

Then in iLogic use the following code:

 

 

Select Conveyortype
	Case = "Bucket"
		Components.Add("BucketAssyName", "Bucket_Assy_Filename")
	Case = "Belt"
		Components.Add("BeltAssyName", "Belt_Assy_Filename")
	Case = "Screw"
		Components.Add("ScrewAssyName","Screw_Assy_Filename")
	End Select

 

 

  

After you select the type in the parameters, Inventor will load the assembly.

If you want to unload the other components use:

 

 

Components.Delete("ComponentNameToDelete")

 

 

and add this in the select statement.

 

Kind regards,

 

Alexander Boogaard


Kind regards,
Alexander Boogaard