iLogic Assembly Help

iLogic Assembly Help

mwighton
Collaborator Collaborator
445 Views
9 Replies
Message 1 of 10

iLogic Assembly Help

mwighton
Collaborator
Collaborator

Hi,

 

I am trying to write a code in an assembly document that will open a series of documents that are saved in the same folder as the main assembly. The basic idea of the code I have right now is as follows:

 

  1. Open assembly file in inventor->ilogic rule starts upon opening
  2. First rule asks the user to rename the assembly document so that the file can be reused for future assemblies.
  3. Once the user saves the document another rule will start that will ask the user which size they want to use "A or B"
  4. Based on what answer they give a series of documents will open in the assembly and be constrained to eachother.

I have 1 done and it works the way I want.

 

My questions are:

 

How do you open a part from a give file path in the assembly?

How do you constrain the parts to eachother in the assembly?

How do you link parameters between the parts so that they stay linked to eachother?

How do you change the name of each part seperately(again so that the original assembly file can be reused for another go)?

Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
446 Views
9 Replies
Replies (9)
Message 2 of 10

mwighton
Collaborator
Collaborator

Sorry, I have part 1 and 2 done and working properly.

Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
Message 3 of 10

mwighton
Collaborator
Collaborator

Since posting this discussion i figured out a way to do what i want. Now the problem is that I need to save the parts in an assembly as a new name and replace the old ones with the new ones, wihtout losing the constrains and parameter links. How would i go about this?

Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
Message 4 of 10

MechMachineMan
Advisor
Advisor
use command manager and run the control definition for "Save and Replace Component"

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 10

mwighton
Collaborator
Collaborator

will this approach keep the parameters linked?

Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
Message 6 of 10

MechMachineMan
Advisor
Advisor
Not sure. You could probably test it out though.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 7 of 10

mwighton
Collaborator
Collaborator
thanks. i will try and inform this discussion about the results.
Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
Message 8 of 10

mwighton
Collaborator
Collaborator

so now heres the update.

 

i have a rule that opens an assembly and at the trigger of the document opening each individual part triggers as well. the rule that triggers is a save as code that allows the user to chose a location and file name for the parts.

when this finishes it asks the user if they want to rename the assembly file. after renaming everything all but 1 part update to the new part names. when i open the part individually in a new window it shows the save file as the correct name but in the browser it shows the old name. 

 

In addition to this the parameters are still be linked to the old part files and not the renamed ones.

Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
Message 9 of 10

mwighton
Collaborator
Collaborator
the parts stay constrained correctly. I have a part of the rule that updates the document but that didnt help.
Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes
Message 10 of 10

mwighton
Collaborator
Collaborator

newest update.

 

when my rule asks the user which of 2 options it opens the correct file.

 

after the user renames all the parts and the assembly for choice 1 the parameters get linked to the new saved files and not to the old files.

 

after the user renames all the parts and the assembly for choice 2 the parameters stay linked to the old files yet the rule is structurally the same. the only thing that is different is some words in the message windows.

 

anyone know the reason why this is happening?

Did this post help out? Hope it did.
If so please use the 'Accept as Solution' or 'Kudos' Button below.
God Bless

Mwighton
0 Likes