Hello Inventor customisation fans,
I was trying to create a design template in the Multibody Part environment (MBP) for design cases we use almost every day.
We´re relying heavily on semi-finished products (plant construction), so 80% to 90% of our parts are plates, beams, pipes and similar. In most cases we create a welding assembly which has only the semifinished parts which are welded together.
What I expected from the MBP was to be able to preconfigure properties like materials and width, length and height before I create parts which then are placed into the assembly.
Now this doesn´t work right now as probably all of you already know. So I have created some iLogic code that finds the base dimensions of plates (thickness, length, width) and adds this information to the custom properties so it shows up in the BOM.
This works with a template which I have added to this thread. Now what you do is choose this template for the solid bodies which are plates when you derive your parts after you have finished setting up your MBP.
In the template I have embedded an excel sheet, that searches for a numeric thickness value (discrete) in the "thickness" column.
After finding the according entry in the excel sheet it will read out the item number from that column and writes it back into the custom properties.
We´re using a PDM system the files get uploaded to and if the PDM system finds a known item number it will automatically connect the documents to the correct item master.
Right now this works only with one material for every template. Additionaly I want to be able to get a prompt before the part get´s saved, that asks me to define a material based on the data of my style library. Does anybody has an idea how to do that with iLogic code pieces?
I will work on this further and will update the thread with new functionality. Feel free to use, modify and share this.
But please share your results and improvements in this thread.
Important information: This is work in progress and with a high probability there will be bugs or miscalculations.
Use this on your own risk.
All the best
Solved! Go to Solution.
I got one step further into defining the materials, but I´m not happy with the results.
I´ve added a Multivalue Text Parameter which contains all the materials and prompts me for every component when it´s created to define the material.
The problem is I don´t have the info on which part (component) I´m defining the material everytime the prompt comes up.
So I guess it´s better to run a rule in the assembly, which selects all the components and writes their component name into an array. Then I would like to put these values into a form where I can define the component materials.
I´ve found some code that Curtis Waguespeck published on his blog which get´s file informations from the selected component. Right now I try to decypher the code, but I´m stuck on how the commands are for getting a loop that runs through all components and writes the string into an array.
Any ideas on how to do this??
Hope the code below answered your question on 'how the commands are for getting a loop that runs through all components and writes the string into an array':
' get ComponentDefinition of the assembly Dim oAsmCompDef oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Iterate the occurrences Dim oOcc As ComponentOccurrence 'define a array to store the names of occurrences Dim myArrayList As New ArrayList For Each oOcc In oAsmCompDef.Occurrences myArrayList.add(oOcc.Name) Next 'ask the user to select oSelectV = InputListBox("Select from the list", myArrayList, myArrayList.Item(0), "iLogic", "Occurrence Names")
can you put an example assembly + parts, with those rules?
Thank you all!
Your works may be so precious to all! Thank you
what is it specifically you want to know?
I wanted to use this but there are some limitations to the process.
What I can give you is the script I´m using in the template files to get the dimensions.
But it will not work for parts that are not aligned to the base coordinate system i.e. means they are rotated
at least to one of the axis x,y,z.
Unfortunately that is a k.o. criteria for me so I didn´t use this anymore.
All the best
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.