Spare QTY property

Spare QTY property

rcolon9E4ZX
Advocate Advocate
2,455 Views
24 Replies
Message 1 of 25

Spare QTY property

rcolon9E4ZX
Advocate
Advocate

Hello,

 

We generate spare parts lists for our OEM machines. The QTY used in the machine is not necessarily the QTY that should be kept on hand for spare. This means this information should be saved in each job assembly, not the part files. Is there a way to have another QTY property or custom property that I could assign Static Values to? I see that you can set a custom property as instance properties, but I cannot edit the property from the Structured Bill of Material if there is more than one occurence. I also see that a Model State could allow for a unique Bill of Material, but the macro we have always references the Master Model State, so this would be much easier to accommodate with property overrides.

 

Has anyone found a good way to do this? Any ideas would be greatly appreciated.

 

Kind regards,

INV2022.3 Professional

WIN10x64 21H2

0 Likes
2,456 Views
24 Replies
Replies (24)
Message 2 of 25

Frederick_Law
Mentor
Mentor

I usually add a "Spare Parts" Subassembly.

0 Likes
Message 3 of 25

CGBenner
Community Manager
Community Manager

@rcolon9E4ZX 

Echoing what @Frederick_Law suggested, this could also be done using virtual components, built into a virtual sub-assembly.  If it is different every time, it may take a long time to generate this, but if it's a standard kit, you could build it once and then just insert it into every machine assembly.

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M


0 Likes
Message 4 of 25

rcolon9E4ZX
Advocate
Advocate

Thank you for the replies.

 

@Frederick_Law ,

 

The Spare Part subassembly is an interesting approach. Similarly, I am trying the model state and QTY override approach. It has the same spirit of simply overriding the QTY as needed for select items. It took a little massaging, but now my macro can handle a model state input. Hopefully it works with the rest of the macro features.

 

@CGBenner ,

 

I have used virtual components in the past and it is a great way of notating items in the BOM that may not have models or geometry. Our systems are mostly custom or tailored, so this approach might be cumbersome.

 

Kind regards,

0 Likes
Message 5 of 25

blandb
Mentor
Mentor

Can you just add column in a parts list of the assembly bill of materials call "Spares, or Spare Parts". Then just type in the qty required? That way it just taken care of on the drawing, or are you needing to extract this to some system? If so, you could export the parts list to an excel file or other format. Just a thought.

Autodesk Certified Professional
Message 6 of 25

rcolon9E4ZX
Advocate
Advocate

@blandb ,

 

Thank you for the response.

 

Everything is driven from our IAM's. The iProperties are filled from the IAM Bill of Materials GUI. With an IAM as the active document, we run a macro to produce a list in Excel with selected columns and filtering. A spare parts list is one of the output types. When I produce a deliverable spare parts list, it might be the 3rd or 4th iteration through the macro due to assembly updates. The driving factor for having the overrides set in the IAM Bill of Materials is to set them once, instead of after each macro iteration.

 

As for the additional "Spare Parts" column, I was hoping I could take this approach. But a lot of our parts are reused in different assemblies. Changing the values in the bill of material would change the value for the IPT/IAM referenced, which would affect the other assemblies. Also, I am not utilizing an IDW parts list. It looks like a parts list allows you to make a local override for any column. This could possibly work, but this is a big change in our workflow for this single purpose.

 

Kind regards,

0 Likes
Message 7 of 25

Frederick_Law
Mentor
Mentor

No idea what you are doing.

Don't know how your macro produce "spare part list".

 

Some one higher up will decide what will be spare parts and I just put them in subassembly for a "spare part list".

0 Likes
Message 8 of 25

rcolon9E4ZX
Advocate
Advocate

@Frederick_Law ,

 

We tag the Keywords iProperty with a code for bearings, belts, etc. These parts would then be considered spare in any assembly they are placed in. For an assembly, the macro can filter out everything but the tagged components.

 

Regards,

0 Likes
Message 9 of 25

Frederick_Law
Mentor
Mentor

Maybe, thinking out loud .....

Add a "SparePartRatio" iProperties in the part. 0 means no spare. 1 mean 1:1. 0.1 means 1 spare for every 10 in assembly.

Macro will go through assembly and count.  Rounding up or down to integer.

Could also setup Max, Min for each part.

The result should save in assembly.

Message 10 of 25

cadman777
Advisor
Advisor

The experts in the Inventor Customization forum have a way of getting info into the individual part from the assembly. That seems to be the thing you need to do.

 

Combined with @Frederick_Law's comment, you could make a rule that runs from the assembly, searches the top-level BOM for total quantities of parts, and either does a calculation based on those quantities, or looks at a table of qualifications to determine which parts you want to include and what quantity of spare parts you want for each part. Then you can add an iProperty to each part and insert that quantity into that iProperty. Then you can add that iProperty to your drawing PartsList.


It would require some amount of coding, but that would be out of my depth!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 11 of 25

Cris-Ideas
Advisor
Advisor

In principle this is possible how you described. (in the first post)

 

To achieve that you need to write a plugin for inventor and add property to a component. Each component has ability to add custom table of properties in the assembly. 

This information is stored in the assembly level and not part level. So just as you want.

 

How to do that in very detail I am not able to advice as I have not got on this level.

Ask iLogic gurus on customisation forum.

 

Cris.

Cris,
https://simply.engineering
Message 12 of 25

rcolon9E4ZX
Advocate
Advocate

I have tried creating a Model State called "Spare Parts". In this model state, I override the Structured BOM QTY for each BOM row as needed. A problem arises when a part is used within multiple subassemblies: multiple lines are produced with the same part number. I can write code that only allows unique part numbers to show up, but I need a place to put the quantity override.

 

I looked at the Parts Only BOM as each part only appears once and all part quantities reflect total instances in the assembly. But the Parts Only BOM will not let me override the QTY with Static Quantity. 

 

There must be a way to easily accomplish what I am trying to do. Others will use the same method, so it should not get complicated. I expect to manually input a number for every line, but I want to do this only once within Inventor, not in the excel list afterward. I can add BOM properties if needed, but the values need to save in the assembly, not the part. For example, using a custom iproperty in an assembly and setting to Instance Property for the row will not override the property value for the IPT. The problem I run into with Instance properties is that I cannot edit from the Bill of Materials form if there are multiple instances of the same part.

 

I am stuck. Any ideas?

 

Kind regards,

Rafael

0 Likes
Message 13 of 25

Frederick_Law
Mentor
Mentor

Just thinking out load.

For each part that need spare part.

Copy and add -Spare at the end: M5x10-Spare.

Put as many as you need in assembly.

Message 14 of 25

Cris-Ideas
Advisor
Advisor

If you are writing the code, you should try to use Component attribute to store SpareQTY

 

https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=AttributeSets

https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=ComponentOccurrence

https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=ComponentOccurrence_AttributeSets

 

Unfortunately I lost all my code for Inventor plugin and have no example how to use it.

 

Adding attribute SpareQTY to assembly component will give you exactly what you want.

 

Cris.

 

Cris,
https://simply.engineering
0 Likes
Message 15 of 25

johnsonshiue
Community Manager
Community Manager

Hi! I believe Instance Property is what you are looking for. It is a property associated with an instance of a component within an assembly. For example, you have 4 identical road sign parts (4 instances of the same part) in an assembly. You can right-click on each -> Instance Property and assign a unique property called "Direction" (north, south, east and west).

And, the property is indeed saved in the hosting assembly, not within the individual part documents.

Many thanks!



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes
Message 16 of 25

A.Acheson
Mentor
Mentor

I am thinking that the idea of a spare parts sub assembly from @Frederick_Law  is the most straight forward and easy to use approach. I am not totally sure of your process for creating qty's for purchasing and how your displaying the BOM to the Assembly crew so really there is many way's you can work with the assembly approach.  Either directly in the BOM or in the Partlist in the drawing.

 

Some potential workflows in the BOM:

  1. You could just have the assembly completely independent of the main assembly and in your BOM export to excel combine the parts qtys either manually or by code. Obviously this might not be a very transparent method and open to mistakes. 
  2. Create a sub assembly in the main assembly and add physical parts to the assembly. This way the total counts for BOM export are correct for purchasing. This however brings a drawback in that the qty's for assembly purposes are now incorrect as they include the spare parts and there maybe confusion as to the extra qty's. A solution is to set the Sub assembly  Bom Structure to Normal in the assembly when exporting BOM for ordering then switch the Occurrence Bom Structure to reference afterwards for Assembly Accuracy in the Drawing. 

Manual approach to solve the qty potential confusion. 

AAcheson_0-1670193134745.png

And here is an optional code method to work with a spare parts sub assembly. I have chosen to add correct qty's of occurrences as the mass is then correct for the assembly in case you want to check shipping requirements etc. 

 

Dim oAssyDoc As AssemblyDocument = ThisDoc.Document
    Dim oAssyDef As AssemblyComponentDefinition = oAssyDoc.ComponentDefinition
	
	'Set Name of Spare parts Assembly
	Dim NewFullFileName As String = ThisDoc.Path & "\" & ThisDoc.FileName(False) & "-SpareParts.iam"
	Dim oSpareAssyDoc As AssemblyDocument
	Dim oSpareAssyOcc As ComponentOccurrence 
	Dim oMat As Matrix = ThisApplication.TransientGeometry.CreateMatrix

	For Each oRefDoc As Document In oAssyDoc.ReferencedDocuments
		If NewFullFileName = oRefDoc.FullFileName Then
			oSpareAssyDoc = oRefDoc
			Dim RefOccs As ComponentOccurrencesEnumerator = oAssyDef.Occurrences.AllReferencedOccurrences(oRefDoc)
			oSpareAssyOcc = RefOccs(1)
			Exit For
		End If	
	Next
	
	If oSpareAssyDoc Is Nothing Then
		'Check if you have allready create an assembly on Disc
		If Not IO.File.Exists(NewFullFileName) Then
			' Create a new sub-assembly  
			oSpareAssyDoc = ThisApplication.Documents.Add(kAssemblyDocumentObject, , False)
			oSpareAssyDoc.SaveAs(NewFullFileName, False) 
		
		    ' Create an instance Of the New Sub-assembly
		    oSpareAssyOcc = oAssyDef.Occurrences.AddByComponentDefinition(oSpareAssyDoc.ComponentDefinition, oMat)
		Else
			' Create an instance Of the New Sub-assembly
			oSpareAssyOcc = oAssyDef.Occurrences.Add(NewFullFileName, oMat)
			oSpareAssyDoc = oSpareAssyOcc.Definition.Document
		End If
	End If
	
	'Set This Occurrence to Reference in the context of Main Assembly
	'oSpareAssyOcc.BOMStructure = BOMStructureEnum.kReferenceBOMStructure
	
	'[Selecting Component using Pick
	While True
		Dim oSparePartoOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"Select a Part to add to the Assembly, Press Esc when Complete") 	

			' If nothing gets selected then we're done	
		If IsNothing(oSparePartoOcc) Then Exit While 
		Dim Qty As Integer = InputBox("Current Qty Below, Enter A New Qty?", oSparePartoOcc.Name, "1")
		Dim i As Integer
		For i= 1 To Qty
			' Create an instance of the new sub-assembly
			oSpareAssyOcc.Definition.Occurrences.AddByComponentDefinition(oSparePartoOcc.Definition, oMat)
		Next
	End While
	']

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 17 of 25

rcolon9E4ZX
Advocate
Advocate

@Cris-Ideas ,

 

You know, I had the word attribute floating in my head this weekend from recalling an old thread. Is this essentially Instance Properties, or different?

 

Kind regards,

0 Likes
Message 18 of 25

rcolon9E4ZX
Advocate
Advocate

@johnsonshiue ,

 

Thank you for the reply. Instance property is the most logical place for this information to reside. The only thing I did not like is the inability to modify an instance property using the Bill of Materials form in the context of an IAM if more than one occurence of the part is present. Am I stuck selecting all occurences in the model tree and performing the batch edit this way?

 

Kind regards,

0 Likes
Message 19 of 25

rcolon9E4ZX
Advocate
Advocate

@A.Acheson ,

 

I appreciate the reply. I am looking for something linked. As the design evolves, or we do a Copy Design for the next job, the Spare Parts subassembly would need to be adjusted. It is another layer of work, and although it would be functional, it is likely to be inaccurate without thorough checking.

 

Kind regards,

0 Likes
Message 20 of 25

cadman777
Advisor
Advisor

Maybe you can extract from an Excel file the quantities of each spare part into the spare parts assembly?

That way you can reduce the work involved with that extra process?

Then just update the Excel file and your quantities of each part update in the spare parts assembly? 

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator