Auto numbering for new files in Inventor 2018

Auto numbering for new files in Inventor 2018

cekol20
Contributor Contributor
1,122 Views
11 Replies
Message 1 of 12

Auto numbering for new files in Inventor 2018

cekol20
Contributor
Contributor

Hello everybody,

I have a question to You. I know that is possible to get auto numbering in Vault client but I have just Vault basic. I think that I cant switch in settings of autonumbering for new files. I want to get new filename like (for example A-000001 then A-000002 ...). Is it any solution to do this without Vault client? Somebody know how to do this?

Thanks for all responses, regards!

0 Likes
Accepted solutions (1)
1,123 Views
11 Replies
Replies (11)
Message 2 of 12

Michael.Navara
Advisor
Advisor

It is feasible, but the code is too complex for this forum. The implementation depends on your needs.

In general you need to define detailed specification of you needs which is important for successful implementation:

  • How many users will use this auto-numbering tool
  • Where you will store the information about used numbers
  • Which programs will access this source of numbers
  • Can user work off-line
  • Etc.

This is just a sample of basic questions which needs to be answered before you start coding.

0 Likes
Message 3 of 12

cekol20
Contributor
Contributor

Just I need it for 1 PC for only myself uses . If if will be possible I want to have chance for us auto numbering or skip this step. I wondered that sources of numbers will in excel (or maybe do You know any better ideas)?

0 Likes
Message 4 of 12

Michael.Navara
Advisor
Advisor

In this simple case use time stamp for auto-number. I use this for my hobby projects and it works fine.

The easiest way is to implement your custom external iLogic rule and use them as "Save" command.

This rule can suggest filename based on current date and time like "A-20240902-0735.iam".

 

Another simple approach is to use simple text file with the last used sequential number and each click on Save button suggest the next one and update the value in this source.

0 Likes
Message 5 of 12

cekol20
Contributor
Contributor

Both solution sounds good but could you share a code for external iLogic rule for sign a file of date and hour or could you explain how to do option number 2 with "simple text file with the last used sequential number"?

0 Likes
Message 6 of 12

Michael.Navara
Advisor
Advisor

In attachment is the sample code from T4I. It can be used as good starting point for you.

0 Likes
Message 7 of 12

cekol20
Contributor
Contributor

Thanks so much, it works so good but I have one question. Is it possible to create every parts in same folder like project. This macro create a new folder in project and put every files (.ipt .iam) over there. I dont know witch one line I should delate.

0 Likes
Message 8 of 12

Michael.Navara
Advisor
Advisor

Please don't confuse this forum with free code generator.

Now you have a code which works. You can look inside, try to debug them, use Logger to check variables and its values.

It is not hard to adapt the code for your needs but try it yourself. 

Message 9 of 12

cekol20
Contributor
Contributor

Ok, I understand that I ask about too much but I tried change it alone and still I have a problem with it. If you can help with it, I will be grateful!

0 Likes
Message 10 of 12

Michael.Navara
Advisor
Advisor
Accepted solution

Try to focus on this line in my code.

saveFileDialog.FileName = dirInfo.FullName & "\" & fileName

 

Message 11 of 12

cekol20
Contributor
Contributor

Thank You so so much!

0 Likes
Message 12 of 12

cekol20
Contributor
Contributor

Hello, I got a code from Michael.Navara and it works good, but I want to change one thing. This code create a folder in project and there are localizated all creating parts. I want to that every parts would creating in project folder. Anybody know how to change a code that works like I want?

0 Likes