Project Number from Part Number using iLogic

Daniel.buzinari
Advocate
Advocate

Project Number from Part Number using iLogic

Daniel.buzinari
Advocate
Advocate

Hi!

 

All my files (iam and ipt) start with the project number I am designing them for.

 

Does anyone have an iLogic rule that could extract these first digits from the file name and automatically populate it to project number?

 

Thank you

0 Likes
Reply
Accepted solutions (1)
450 Views
3 Replies
Replies (3)

johnsonshiue
Community Manager
Community Manager
Accepted solution

Hi Daniel,

 

This one is easy. Even I can do it. Here you go!

 

Dim PN_Project As String
PN_Project = iProperties.Value("Project", "Part Number")
iProperties.Value("Project","Project")=Left(PN_Project,2)


Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer

Daniel.buzinari
Advocate
Advocate

Thanks John! 

 

I will try to figure out now how to bring in the file name instead.

 

I use Vault with Auto-Naming, so my ipt files usually follow the patterns PPPP-NNNNN (in P the Project No and N the auto sequence created by Vault).

 

Our Part Number uses a macro to be populated, based on the element (plate thickness x width, or structural member spec for example).

 

Are there any courses to learn a bit more about iLogic and how to write the scripts?

0 Likes

A.Acheson
Mentor
Mentor

Hi @Daniel.buzinari 

 

For learning do an internet search using ilogic and the task you want to do and you will usually find this forum and post that might help you. There is also the ilogic help files

Here is the filename function found under document functions.

 

Dim fileNameWoExt As String = ThisDoc.FileName(False)

 

You can also sort of make out what each snippet does by navigating the ilogic browser looking in each category and adding the snippets of code and hover the cursor over the text to display a tool tip which is instructions on its function. 

 

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