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?)?
@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
Chris Benner
Inventor Tube & Pipe, Vault Professional
Cad Tips Tricks & Workarounds | Twitter | LinkedIn
Autodesk University Classes:
Going With The Flow with Inventor Tube and Pipe | Increasing The Volume with Inventor Tube and Pipe | Power of the Autodesk Community | Getting to Know You | Inventor Styles & Standards |Managing Properties with Vault Professional | Vault Configuration | Vault - What is it & Why Do I Need It? | A Little Less Talk - Tube & Pipe Demo | Change Orders & Revisions - Vault, Inventor & AutoCAD | Authoring & Publishing Custom Content
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:
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
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
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.