<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use grams in Bill of Materials in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3430347#M393860</link>
    <description>&lt;P&gt;Hi shockerty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a quick update. Here's another version with a listbox that allows you to select a unit of mass.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;question = MessageBox.Show("Are you sure you want to change the units of mass?", 

"iLogic",MessageBoxButtons.YesNo)
if question = vbno then
Return
Else

oStringArray = new string(){"Kilogram", "Gram", "Slug", "Pound", "Ounce"}

oUnit = InputListBox("Select a unit of Mass", oStringArray, "Kilogram", "iLogic", "Mass Units")

	'kKilogramMassUnits = 11283
	'kGramMassUnits = 11284
	'kSlugMassUnits = 11285
	'kLbMassMassUnits = 11286
	'kOunceMassUnits = 11287
	
	If oUnit = "Kilogram" then 
	oUOM = 11283
	Else If oUnit = "Gram" then 
	oUOM = 11284	
	Else If oUnit = "Slug" then 
	oUOM = 11285
	Else If oUnit = "Pound" then 
	oUOM = 11286
	Else If oUnit = "Ounce" then 
	oUOM = 11287
	Else
	End if

	'Define the open document
	Dim openDoc As Document
	openDoc = ThisDoc.Document
	Dim docFile As Document 

'	'kAssemblyDocumentObject = 12291 
'	If openDoc.DocumentType = 12291 Then

	'Iterate though the files in the assembly
		For Each docFile In openDoc.AllReferencedDocuments		
		'format  file name		
		Dim FNamePos As Long
		FNamePos = InStrRev(docFile.FullFileName, "\", -1)		         
		Dim docFName As String	
		docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)       
		            	            	
		'set mass units as gram
		docFile.unitsofmeasure.massunits = oUOM 
		Next	
'	Else	
'	MessageBox.Show("This is not an assembly file.", "iLogic")
'		
'	End If
End if&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2012 14:39:02 GMT</pubDate>
    <dc:creator>Curtis_Waguespack</dc:creator>
    <dc:date>2012-04-25T14:39:02Z</dc:date>
    <item>
      <title>Use grams in Bill of Materials</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3429021#M393858</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry this is really nooby, but how can I change the mass in the Bill of Materials to g instead of kg?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2012 19:41:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3429021#M393858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-24T19:41:19Z</dc:date>
    </item>
    <item>
      <title>iLogic to change the Mass Unit for each part in an assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3429205#M393859</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can change the units of mass for each file by going to the Tools tab &amp;gt; Document Settings button &amp;gt; Units tab. If you do this in your template then all of the files you create going foward that use that template will automatically have the mass units set to Gram.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However if you're wanting to do this for existing files, as you want to do when trying to updat the BOM, you would be required to open each file (since this is set in the document settings). This can be quite a chore though, so I've included an ilogic rule here to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use this link to learn about setting up an ilogic rule if you've not done it before:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com/2012/01/creating-basic-ilogic-rule-with-event.html"&gt;http://inventortrenches.blogspot.com/2012/01/creating-basic-ilogic-rule-with-event.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A target="_blank" href="http://inventortrenches.blogspot.com"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;question = MessageBox.Show("Are you sure you want to change the units of mass?", "iLogic",MessageBoxButtons.YesNo)
if question = vbno then
Return
Else

	oUnit = InputRadioBox("Select a unit of mass", "Gram", "Kilogram", True, "ilogic")

	'kKilogramMassUnits = 11283
	'kGramMassUnits = 11284
	'kSlugMassUnits = 11285
	'kLbMassMassUnits = 11286
	'kOunceMassUnits = 11287
	
		If oUnit = True then 
		'set to gram
		oUOM = 11284	
		Else 
		'set to kilogram
		oUOM = 11283	
		End if

	'Define the open document
	Dim openDoc As Document
	openDoc = ThisDoc.Document
	Dim docFile As Document 

	For Each docFile In openDoc.AllReferencedDocuments		
		'format  file name		
		Dim FNamePos As Long
		FNamePos = InStrRev(docFile.FullFileName, "\", -1)		         
		Dim docFName As String	
		docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)       
		'set mass units as gram
		docFile.unitsofmeasure.massunits = oUOM 
	Next	
End if&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2012 21:41:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3429205#M393859</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2012-04-24T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use grams in Bill of Materials</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3430347#M393860</link>
      <description>&lt;P&gt;Hi shockerty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a quick update. Here's another version with a listbox that allows you to select a unit of mass.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;question = MessageBox.Show("Are you sure you want to change the units of mass?", 

"iLogic",MessageBoxButtons.YesNo)
if question = vbno then
Return
Else

oStringArray = new string(){"Kilogram", "Gram", "Slug", "Pound", "Ounce"}

oUnit = InputListBox("Select a unit of Mass", oStringArray, "Kilogram", "iLogic", "Mass Units")

	'kKilogramMassUnits = 11283
	'kGramMassUnits = 11284
	'kSlugMassUnits = 11285
	'kLbMassMassUnits = 11286
	'kOunceMassUnits = 11287
	
	If oUnit = "Kilogram" then 
	oUOM = 11283
	Else If oUnit = "Gram" then 
	oUOM = 11284	
	Else If oUnit = "Slug" then 
	oUOM = 11285
	Else If oUnit = "Pound" then 
	oUOM = 11286
	Else If oUnit = "Ounce" then 
	oUOM = 11287
	Else
	End if

	'Define the open document
	Dim openDoc As Document
	openDoc = ThisDoc.Document
	Dim docFile As Document 

'	'kAssemblyDocumentObject = 12291 
'	If openDoc.DocumentType = 12291 Then

	'Iterate though the files in the assembly
		For Each docFile In openDoc.AllReferencedDocuments		
		'format  file name		
		Dim FNamePos As Long
		FNamePos = InStrRev(docFile.FullFileName, "\", -1)		         
		Dim docFName As String	
		docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)       
		            	            	
		'set mass units as gram
		docFile.unitsofmeasure.massunits = oUOM 
		Next	
'	Else	
'	MessageBox.Show("This is not an assembly file.", "iLogic")
'		
'	End If
End if&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 14:39:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/use-grams-in-bill-of-materials/m-p/3430347#M393860</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2012-04-25T14:39:02Z</dc:date>
    </item>
  </channel>
</rss>

