Inventor Customization

Inventor Customization

Reply
Valued Contributor
falkmassmann
Posts: 82
Registered: ‎05-30-2008
Message 1 of 6 (322 Views)
Accepted Solution

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

322 Views, 5 Replies
09-20-2012 05:48 AM

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

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

 

Valued Contributor
falkmassmann
Posts: 82
Registered: ‎05-30-2008
Message 2 of 6 (313 Views)

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

09-20-2012 07:46 AM 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

ADN Support Specialist
xiaodong.liang
Posts: 1,303
Registered: ‎06-12-2011
Message 3 of 6 (297 Views)

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

09-25-2012 05:36 PM in reply to: falkmassmann

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

 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Valued Contributor
falkmassmann
Posts: 82
Registered: ‎05-30-2008
Message 4 of 6 (278 Views)

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

10-01-2012 02:39 AM in reply to: xiaodong.liang

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

Valued Contributor
pompeo79
Posts: 96
Registered: ‎02-08-2011
Message 5 of 6 (153 Views)

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

11-25-2013 05:06 AM 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

Valued Contributor
falkmassmann
Posts: 82
Registered: ‎05-30-2008
Message 6 of 6 (139 Views)

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

11-26-2013 03:31 AM 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

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.