I need a little help please.
I have an inventor part with the name “0955-P05”. To break it down the Job # is 0955 and the Mark # is P05
The code below will automatically take whatever the file name and split it to fill in the Job # and Mark #
'MarkNumber and Job Information
'Filename Convert
Part_Number = iProperties.Value("Project", "Part Number")
iProperties.Value("Custom", "Job" ) = "=" & Left(Part_Number,4)
iProperties.Value("Custom", "MarkNumber") = "=" & Right(Part_Number,3)
The code works great in till my Mark # reaches P99
I know what you’re thinking but I can’t change the Mark #s to P001 and fix the code that way. The whole company is already set up with this Mark # system and they will not change it.
I was wondering if anyone might have any ideas or if there is a way to make the Mark # whatever is after the – in the file name or something like that.
Please help me Obi Wan you're my only hope…
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Hi jddickson,
This should do it as long as the dash is always the seperator. It divides the string into element(0) and element(1).
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Part_Number = iProperties.Value("Project", "Part Number")
sJobNumber = Split(Part_Number, "-")(0)
sMarkNumber = Split(Part_Number, "-")(1)
MessageBox.Show("Job #: " & sJobNumber, "iLogic")
MessageBox.Show("Mark #: " & sMarkNumber, "iLogic")