Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bill of Materials Won't Update

4 REPLIES 4
Reply
Message 1 of 5
lakerfisher
6175 Views, 4 Replies

Bill of Materials Won't Update

I changed the names and locations of my parts in an assembly, opened the drawing, and found all of the parts and names. I then looked at the parts list on the assemblies in the drawings. Even though the assemblies updated, the part name did not update. How do I update the BOM to match the assembly (I thought it would do this automatically?)?

 

Capture.JPG

4 REPLIES 4
Message 2 of 5
cbenner
in reply to: lakerfisher


@lakerfisher wrote:

I changed the names and locations of my parts in an assembly, opened the drawing, and found all of the parts and names. I then looked at the parts list on the assemblies in the drawings. Even though the assemblies updated, the part name did not update. How do I update the BOM to match the assembly (I thought it would do this automatically?)? 

 


Welcome laker,

 

Is your parts list using the iproperty "Description"?  That may or may not change if the filename is changed, you may need to manually change the Description.  In your assembly edit the BOM, or from your drawing right click on the parts list and select Bill Of Materials to edit.  Check you description field, and if necessary change it to match the renamed files.  This all assuming your parts list uses Description.

 

AutoCAD 2013; AuoCAD Electrical 2013; IV 2013 Professional: Tube and Pipe, Frame Generator, Content Center; Vault Professional 2013: Client, ECO

 

 

Message 3 of 5

Hi lakerfisher,

 

It might depend on how you changed the names of your files ( I'm assuming you did this with Windows Explorer),  but basically Inventor puts the file name in the Part Number iProperty field by default, and that is what you're looking at in the BOM editor.

 

To resolve this you can do one of these things:

  1. Edit each part and then right-click on the top level browswer node and choose iProperties > Project tab > and then enter the file name in the Part Number iProperties field.
  2. Edit the Part Number fields from the BOM grid (as shown in your screen shot).
  3. Run this iLogic snippet from the assembly, and it will write the file name (less the extension) for each part to the Part Number iProperty.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

' set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
'check for and skip virtual components
'(in case a virtual component trips things up)
If Not TypeOf oOccurrence.Definition Is VirtualComponentDefinition Then
shortName =  Left(oOccurrence.Name, InStrRev(oOccurrence.Name, ":", -1)-1)  
'write name to Part Number iProperty     
iProperties.Value(oOccurrence.Name, "Project", "Part Number")  =  shortName           
Else
End If
Next

 

Message 4 of 5
spsid13
in reply to: Curtis_Waguespack

Hi Curtis,

 

Your code works fine in an assembly But suppose i have an assembly within which i have many sub assemblies. Now in those sub assemblies the parts do not have part number in the iproperties. Then i am forced to open all sub assemblies and make a rule in each file. Is there a way out where directly just one rule in main assembly will give part numbers to sub assemblies or is there a way the same code can be copied to all sub assemblies in one go?

 

Your help is really appreciated. And thanks for the code.

 

Sid

Message 5 of 5
spsid13
in reply to: Curtis_Waguespack

Also one of the sub assemblies it was showing this error.

 

Argument 'Length' must be greater or equal to zero.

 

more info

 

System.ArgumentException: Argument 'Length' must be greater or equal to zero.
at Microsoft.VisualBasic.Strings.Left(String str, Int32 Length)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at p.b(String A_0)

 

Can you tell me what could be the issue? In future if i get such error your  solution to this could be useful.

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

Post to forums  

Autodesk Design & Make Report