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: 

MBP - deriving base dim´s into Assembly BOM of regular shapes

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
falkmassmann
540 Views, 5 Replies

MBP - deriving base dim´s into Assembly BOM of regular shapes

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

 

Falk

5 REPLIES 5
Message 2 of 6
falkmassmann
in reply to: falkmassmann

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??

 

Falk

Message 3 of 6

Hi,

 

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")

 

Message 4 of 6

Thank you, that helped getting all the parts in one viewlist.

Message 5 of 6
pompeo79
in reply to: falkmassmann

guys,

 

can you put an example assembly + parts, with those rules?

 

Thank you all!

 

Your works may be so precious to all! Thank you

Message 6 of 6
falkmassmann
in reply to: pompeo79

Hi pompeo,

 

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

 

Falk

 

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

Post to forums  

Autodesk Design & Make Report