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: 

Part Quantities

36 REPLIES 36
SOLVED
Reply
Message 1 of 37
SKinzel
2376 Views, 36 Replies

Part Quantities

Our individual part drawings reference the quantity of that part used in an assembly.  Is there any way to get the quantity number for a part from an assembly and insert it in the individual part drawing?  Currently I manually put this in but sometimes I forget to do this or I enter an incorrect number.

 

I haven't been able to find anyway to do this but any ideas on how to do this to keep my opportunites to make a mistake to a minimum?

Stuart Kinzel
Inventor 2013-64bit, HP EliteBook8740w Intel Core i5CPU 2.67 GHz
8GB memory
Windows 7 64bit
36 REPLIES 36
Message 21 of 37
IgorMir
in reply to: mrattray

Hi Mike,

You didn't upset me at all. Honestly. We are all friends here. That's what I believe in firmly.

Let's the OP to decide what he needs for his business. I am sure - we all have provided him with enough information to conceder the best possible rout to take.

Best Regards,

Igor.

Web: www.meqc.com.au
Message 22 of 37
SKinzel
in reply to: mrattray

We may be working at the same shop, lol.  Each copy of our drawings also gets a stamp before it is released to the shop.  This stamp includes the job number and the quantity to be manufactured even though this information is suppose to be in the title block of the drawing already. 

 

The icing on the cake is that our "B" sized drawings are on LEGAL size paper so drawing real estate is at a premium.  We've slowly been introducing actual B sized drawings into the shop but they haven't been happy about it even though it should make our drawings much more legible.  And yes the slighest change in drawing procedure/style causes major conflict with the shop floor.

Stuart Kinzel
Inventor 2013-64bit, HP EliteBook8740w Intel Core i5CPU 2.67 GHz
8GB memory
Windows 7 64bit
Message 23 of 37
SKinzel
in reply to: IgorMir

The iLogic code is exactly what I was hoping to find.  I want a way to place the quantity on the drawing that happens more or less automatically and removes a potential human error.  It is much more likely that I will spot a wrong quantity if the actual assembly model doesn't have the correct number of occurances in it than I am to spot an incorrectly typed in number on the individual drawing.  So if the quantity shown on my part drawings is directly tied to the quanity that shows up on my assembly BoM then that should be one less chance for me to screw up.

 

I haven't yet had a chance to play with the code to see if the cut and paste was getting some garbage characters since I just finished a "hurry up why don't you have this done yet" projects and am now working on the next "hurry up why don't you have this done yet" project.

Stuart Kinzel
Inventor 2013-64bit, HP EliteBook8740w Intel Core i5CPU 2.67 GHz
8GB memory
Windows 7 64bit
Message 24 of 37
rhasell
in reply to: SKinzel

I have had quite a few instances where the client wants the part drawings split from the assembly drawings and the quantites need to be placed on each drawing sheet. In this case the part BOM QTY becomes a manual process, and mistakes do happen.

 

The other instance where it is usefull is Laser cutting, each part needs a QTY attached to it, the only other way to get an accurate QTY is to place the GA off sheet.

 

The next issue to be solved is the Sub-Assembly quantities, this is still a manual process, at least for me it is.

Reg
2024.2
Please Accept as a solution / Kudos
Message 25 of 37
mrattray
in reply to: rhasell


@rhasell wrote:
The next issue to be solved is the Sub-Assembly quantities, this is still a manual process, at least for me it is.

It doesn't have to be. What are you looking to do with your sub-assemblies?

Mike (not Matt) Rattray

Message 26 of 37
00ash00
in reply to: IgorMir

Hi All,

 

The iLogic code that I attached @ message 11 of this post will add a Qty to all parts and subassemblies, if you run the code from the top assembly. I copied the text file that I attached into a new run and it worked fine, I did see a message above that it wasn't working however as Mike stated coping code from these posts sometimes will copy incorrectly. My work place sounds to be tha same as you guys, everything was to be completed be yesterday and everytime i add extra things to the drawings they want more information. I have written a standalone program in VB.Net which will does our drawing to 90% complete all we do is open them and add any hole notes and move the radius dimentions that seams to move off the page. I processed 288 drawings in under 3 hrs and i still got the same old hurry up bull ****,  I will release my AutoDrafter in the App store shortly just got to remove company info from the templates that it uses.

 

Ash

 

Dell - T1650

Intel(R)Xeon(R) CPU E3-1290 V2 @ 3.70GHz

16GB

64-Bit

Windows 7 Pro

Inventor 2013 Build: 138

Ash

Dell - T1650
Intel(R)Xeon(R) CPU E3-1290 V2 @ 3.70GHz
16GB
64-Bit
Windows 7 Pro
Inventor 2013 Build: 138
Message 27 of 37
rhasell
in reply to: mrattray

Hi Mike

 

Thanks for the response, I was wondering if this should branch off to a new thread, but Ash appears to have to solved the issue already.

 

Our business had a more architecural/structural feel to it.

Starts with a GA/Marking plan which contains both BOM's (Structured for Labels (Custom balloon), and Parts Only for Official QTY's)

Then each Sub assembly is detailed along with the individual parts.

 

This is where it is a manual process,

The Sub Assembly QTY is listed in the VIEW Label. (EG: 4 OFF REQUIRED etc)

I place the Parts BOM for the sub assembly on the sheet, which has a Custom column for multiplication, so I manually type in 4 which in turn muliplies the QTY by 4, giving me the total QTY required to manufacture 4 Sub assemblies.

 

I hope the above is understandable?

Reg
2024.2
Please Accept as a solution / Kudos
Message 28 of 37
SKinzel
in reply to: SKinzel

So I finally was able to try out the iLogic code.  There seems to be an issue that I'm not sure can be resolved.  My assemblies have a mixture of "regular" parts and parts from the Library.  Since Library files cannot be modified I get an error every time the script runs and it tries to add the Custom Property to the library files.

 

In assemblies that don't have any library files it seems to work just fine.

Stuart Kinzel
Inventor 2013-64bit, HP EliteBook8740w Intel Core i5CPU 2.67 GHz
8GB memory
Windows 7 64bit
Message 29 of 37
Greatwhitenorth
in reply to: SKinzel


@SKinzel wrote:

So I finally was able to try out the iLogic code.  There seems to be an issue that I'm not sure can be resolved.  My assemblies have a mixture of "regular" parts and parts from the Library.  Since Library files cannot be modified I get an error every time the script runs and it tries to add the Custom Property to the library files.

 

In assemblies that don't have any library files it seems to work just fine.


We're in the same boat here.  Library parts can't (and shouldn't), be modified.  I think the only way this would work is if the total quantiy number for each part/sub-assembly, was stored inside the top level assembly somehow.  This would also mean the parts & sub-assys wouldn't need updating.

Bob

 

____________________________________________________
Product Design & Manufacturing Collection 2021 | Vault Professional 2021
Dell Precision 7670 | Intel i7-12850HX - 2100 Mhz - 64GB
nVIDIA RTX A3000 12GB | Windows 10/64 Pro
Message 30 of 37

I have a hard time getting my brain around needing to do this, but I'm in a bigger company with ERP and MRP capabilities.  We give them part/assembly drawings and a BOM, they figure out how many of anything to make from that.

 

I understand that its completely different at a smaller company, but if you gave them a flattened BOM, couldn't they figure out how many of each part to make?

 

Looks like you have the problem pretty well figured out, but sometimes the requirements are the problem.

Message 31 of 37
SKinzel
in reply to: tmoney2007

Personally I don't think there is a GOOD reason for the drawing to have a quantity on it and I'd rather leave it off.  From an Engineering standpoint it doesn't really matter to me if we are making one, two, three or however many when it comes to making a drawing.  Especially since the drawings are stamped and the quantity required to fill the order are filled in this stamped area when a drawing is released to manufacturing.  Its a duplication of effort/information that has the potential to cause confusion and/or problems but I haven't been able to convince anybody of this.  On repeat orders the quantity being manufactured could be different from previous orders.   

 

We are kind of an odd combination of Job Shop and OEM.  I would guess that probaby 90% of the parts going through our shop are a "run of one".  We have a very significant inertia to change and any attempt to change is usually greeted with a chorus of "We've always done it this way."

Stuart Kinzel
Inventor 2013-64bit, HP EliteBook8740w Intel Core i5CPU 2.67 GHz
8GB memory
Windows 7 64bit
Message 32 of 37
IgorMir
in reply to: SKinzel

In such a case - how do you deal with, say, fasteners? Do you leave it for the purchasing department to work out how many of a kind is needed for the given assembly?

Regards,

Igor. 

 


@SKinzel wrote:

Personally I don't think there is a GOOD reason for the drawing to have a quantity on it and I'd rather leave it off. 


 

Web: www.meqc.com.au
Message 33 of 37
SKinzel
in reply to: IgorMir

Some of our jobs are stricktly manufactured parts that we supply to other divisions or end users so there are no purchased parts.  For jobs with purchased parts like fasteners, bearings and seals a "Business Manager" fills out requisitions for these based upon the Bill of Material and that is given to Purchasing.  We don't have drawings for these types of parts. 

 

Something similar is done with the manufacturing drawings also.  Each drawing gets physically stamped by the Business Manager and in that stamp there is a field for Order Quantity which gets filled out and is used by Manufacturing.  Yes, this is a duplication of effort and information since the drawing already has a quantity on it but since "We've always done it this way" with the quantities on manufacturing drawings, we continue to do so.

 

Don't spend too much time or effort trying to make sense of or understand our process.  That would be a waste of time Smiley Frustrated

Stuart Kinzel
Inventor 2013-64bit, HP EliteBook8740w Intel Core i5CPU 2.67 GHz
8GB memory
Windows 7 64bit
Message 34 of 37
IgorMir
in reply to: SKinzel

Must be a big company then...Smiley Very Happy

Best Regards,

Igor.

 


@SKinzel wrote:

 

Don't spend too much time or effort trying to make sense of or understand our process.  That would be a waste of time Smiley Frustrated


 

 

 

 

Web: www.meqc.com.au
Message 35 of 37
rhasell
in reply to: IgorMir

Hi all

 

Okay so I have finally used the code in a production environment. It was great thank you. (prtQTY). The risk is common parts and assemblies, The 'Authority' field will change, so what I have done is take Both sets of code and combined them. (Thanks guys, I thought I would share the changes)

 

It is based on the project number, and will do a quick check and update of the number if needed. I have also put in a quit option.

 

I am no Guru on Sub Routines or even iLogic, so if someone can correct me / improve on the code, please post it.

 

(I had to re-post as all my testing was still in the code)

 

 

Sub Main oQTY
oCompDef = ThisDoc.Document.ComponentDefinition
openDoc = ThisDoc.Document

	If iProperties.Value("Project", "Project")=""
		oProj = InputBox("Change Project Name", "Project Name", iProperties.Value("Project", "Project"))
		iProperties.Value("Project", "Project")=oProj
	End If

'get the project number of this assembly and use it to build the name of a custom property, i.e. "4100_QTY"
customPropertyName = CStr(iProperties.Value("Project", "Project")) & "_QTY"

	oQ=MessageBox.Show(customPropertyName, "Project Number",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Question)
		If oQ=vbNo
		Call oProject
		ElseIf oQ=vbCancel
		MessageBox.Show("Cancelled", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
		Return
	End If

'Let's open the document that inventor has in focus right now
 

'Let's check to make sure that it's an assembly document.
'We don't want to run this on just a part document as it -
'will have none of the required information! 
If openDoc.DocumentType = kAssemblyDocumentObject Then  
    
    'If it is an assembly document, then we need to get a collection
    'of all the documents that are associated to it. 
    'the following line actually does that, while at the time time
    'starts the loop to look at each one of those documents. 
    
    'imagine that it's written out in this way : 
    'For each Document file in the collection of ALL the document
    'files that are in this open document, do the stuff below... 
    For Each docFile In openDoc.AllReferencedDocuments
        
        'First thing first, we need to make a string that can represent the 
        'document that we're working on. This way it will be easier to 
        'call on that document when we want to make changes to the iproperties. 
        'this is no different than if you just typed out : 
        '
        'iProperties.Value("Part_Name_Here.ipt", "Project", "Authority") 
        '
        'But because we are doing this dynamically, we don't have to type that 
        'about line out for every single part that is in the document. 
        '
        'FNamePos is getting the number of spaces that it takes to get to the 
        'very last back slash in the full file name of our document.         
        FNamePos = InStrRev(docFile.FullFileName, "\", -1)        
        
        'We can then take that number (position) and use it to cut off all of the 
        'file path that we don't need. In this case, it's the front of the path
        'that we're getting rid of, leaving us with just the file name.
        docFName = Mid(docFile.FullFileName, FNamePos + 1, Len(docFile.FullFileName) - FNamePos)
        
        'Let's make sure that we can even change this part. If we can, then we'll continue. 
        If docFile.IsModifiable = True Then
            
            'Because you can only grab the occurrences from an assembly document
            'we need to fill up that empty AssemblyDocument container with an object
            'that we know is definitely an assembly document. Because that was one
            'of the first checks we made up there on this open document, we can safely
            'declare that assemblyDoc (Which is an AssemblyDocument) is equal to 
            ' openDoc (Which is just a regular old Document)             
            assemblyDoc = openDoc        
            
            'While we're at it, let's go on and define the empty ComponentDefinition container
            '(we named ours assemblyDef) with some sort of content. 
            assemblyDef = assemblyDoc.ComponentDefinition
            
            'Now we need to collect every instance of the document against
            'our open assembly and put them all inside of partQty. 
            partQty = assemblyDef.Occurrences.AllReferencedOccurrences(docFile)
            
                'Now that we have our collection of instances, we need to populate
                'our target iproperty with the total amount. 
                
                'Instead of just throwing that amount in there, let's make sure that
                'the value inside of the target iProperty isn't already equal to our count. 
                'If it is equal, then we don't have to change anything (which saves us time!),
                'but if it isn't equal then we will need to change it. 
                
                'The Try statement is here because of the next if statement ---
                '
                'If partQty.Count <>  iProperties.Value(docFName, "Project", "Authority") Then'
                '
                'If we just compare the two values, there is a small chance that our target
                'iProperty is already set to something that is NOT a number, which would create
                'an error (as you can't compare numbers against things that aren't numbers). 
                'So, we TRY to complete that if statement, and if there is an error (The CATCH)
                'we just force that target to equal our part qty total. 
                Try
						If partQty.Count <>  iProperties.Value(docFName, "Custom", customPropertyName) Then                
						iProperties.Value(docFName, "Custom", customPropertyName) = partQty.Count
                    End If                      
                    Catch
					iProperties.Value(docFName, "Custom", customPropertyName) = partQty.Count
                End Try
        End If
    Next
Else

'This is here to warn the user that they are attempting to run this in a document that is invalid!
'we don't want them running things that aren't correct! Force them to obey! 
MessageBox.Show("You must have a valid Assembly document open before using this code!", "File Type Mismatch!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
End If 
iLogicVb.UpdateWhenDone = True 
MessageBox.Show("Completed", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
End Sub

Private Sub oProject
	oProj = InputBox("Change Project Name", "Project Name", iProperties.Value("Project", "Project"))
	iProperties.Value("Project", "Project")=oProj
	Main
End Sub

 

 

Reg
2024.2
Please Accept as a solution / Kudos
Message 36 of 37
Raider_71
in reply to: rhasell

Hi guys just a quick question. Would it not be a good idea to rather have a property inside the IDW rather which can be updated programmatically. This property can then be updated from the Assy BOM values reflecting the number of instances of each part/sub assy inside the main Assy. That way you don’t have to worry about content centre parts being updated and only idw’s, which have parts that have been inserted into the main assy, will be updated.

 

Cheers

Message 37 of 37
Nickvanleeuwen
in reply to: rhasell

Hello,

 

I have a question about the iLogic rule.

Is it possible to apply this rule only for sheet metal parts? I only need the numbers of the sheet metal parts.

 

Hopefully someone can help me.

 

Thanks in advance.

 

 

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

Post to forums  

Autodesk Design & Make Report