Auto Numbering

Auto Numbering

timothy_berg
Advocate Advocate
970 Views
11 Replies
Message 1 of 12

Auto Numbering

timothy_berg
Advocate
Advocate

Looking for some iLogic help with creating sequential numbers for subassy's and parts, an example would look something like this:

 

MASTER ASSY - 001

  SUB ASSY - 002

   PART - 005

   PART - 006

   PART - 007

  SUB ASSY - 003

   PART - 008

   PART - 009

   PART - 010

   PART - 011

  SUB ASSY - 004 (etc.) rule would count all sub assys and number according to the qty of sub assys in the master assy

   PART - 012

   PART - 013 (etc.) rule would number all parts starting with the next number in sequence after the count of sub assys

 

the "000" numbers are than used for CNC tags, drawing numbers, etc., I all ready have the CNC and drawing number part figured out, I would like to automate the numbering sequence, if possible.  I'm sure there is a thread where this is solved or close enough that i can figure it out, but I haven't had any success finding it.

0 Likes
971 Views
11 Replies
Replies (11)
Message 2 of 12

NachoShaw
Advisor
Advisor
Hi

In code, you would to get the file type by looping the ReferencedFiles and have 2 counters

Dim PartCounter As Double
Dim AssyCounter As Double

PartCounter = 000
AssyCounter = 000

Select Case oDoc.Document.Filetype
Case is kAssembly
oDoc.Name = "Assy_" & AssyCounter
AssyCounter = AssyCounter + 1
Case is kPart
oDoc.Name = "Part_" & PartCounter
PartCounter = PartCounter + 1
Enda Select

The harder part is renaming everything from inside an Assembly. You also can't rename an open assembly. Unless of course you are doing everything to a closed assembly

Let me know how you get on please? My code is from memory and I can take a proper look tomorrow


Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 3 of 12

timothy_berg
Advocate
Advocate

Thanks for the response, I did try to use this code and I got an error on every line.

0 Likes
Message 4 of 12

Anonymous
Not applicable

Just wondering if you were able to work out the bugs from this code, I tried to use it but I am also getting quite a few errors.

0 Likes
Message 5 of 12

NachoShaw
Advisor
Advisor
Hey

I hadn't looked because the thread went cold but I can look tomorrow. How are you numbering them? From inside the Assy or though apprentice? Or are you just populating the part numbers etc?

It should be easy enough. You want to do something like:

Get a count of the sub assemblies from top level
Create a dim to hold the count
Loop Assy and check it's type

Create a counter for Assy
Create a counter for part

If it's a part, name = PartCounter+ 1
If it's an Assy, name = AssyCounter +1

Etc etc

If you can give some examples, I can write up a routine (based on your naming method)



Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 6 of 12

Anonymous
Not applicable

I am wanting sequential numbering at the beginning of part numbers only. Is this something that can be added to existing parts? The software that we are using to send parts to the router is pulling from the file name and we need a 3 digit code at the beginning.

 

001_Left_Side

002_Right_Side

003_Top

004_Bottom

 

0 Likes
Message 7 of 12

NachoShaw
Advisor
Advisor
So you only need to update the I properties Part Number?

Yes it can be done. To be clear, assemblies are numbered for example: 5 sub assemblies.
Top level = 001
Each sub, 002, 003 etc

Part numbers 006 onwards

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 8 of 12

NachoShaw
Advisor
Advisor
Is there anything in the Iproperties that state the left, right, top etc?

As a question, these are not unique numbers compared to another assy that will get the same numbering method. How are you controlling that?

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 9 of 12

Anonymous
Not applicable

The software that we are using is picking up the file name located in the general tag of iproperties. It is not referencing the part number.

 

It would not be a problem if the assembly and sub assembly also had numbers. The file names that we are currently using has a code which is specific to the client and item we are producing (ex. 001_ABC_123_45_Left_Side) having the sequence repeat per assembly is actually what I was hoping for.

0 Likes
Message 10 of 12

timothy_berg
Advocate
Advocate

that would be perfect i do not need any other iProperties populated in the sequence and I'm assuming that i would open the master assy and run this rule?

0 Likes
Message 11 of 12

NachoShaw
Advisor
Advisor
Hi

I hadn't realised there were 2 people here, thought I was talking with the option.

Morrissey
Yes, you can loop through the references and change the part number to include the digits at the front.

I'll read thoroughly tomorrow on my pc and get something together by friday


Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 12 of 12

timothy_berg
Advocate
Advocate

Just wondering if this has been solved.

0 Likes