Hello everybody
I have an issue and may be you could help me. I would like to know if is possible to extract text from one property (in my case file name). In my company we use a combination of the file name to get an item number, which we set in the balloons of all drawings, then, currently you have to type it in the balloons manually. I was wondering if this could be done by Inventor. Next some examples.
P-12-50-03 then Item number is 203
P-15-14-05 then Item number is 505
P-18-20-51 then Item number is 851
P-11-25-473 then Item number is 1473
P-13-64-001 then Item number is 3001
I need to extract from the 'part file name' the numbers in Bold. With this new property, I could set it in the balloons and also in my part list and we don't have to do a lot of manual work. Thank you in Advance.Hello Everybody
Hello
Take a look at the SPLIT and RIGHT-function. Split creates an array of Substrings devided by "-" in your case. Take the second arrayfield and get your first number with the right-fuction. Take the complete fourth arrayfield as second part and combine these two parts.
You can try this. Create a button and a textbox
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
Dim pSplit() AsString
pSplit = Split(TextBox1.Text,"-")
Dim a AsString
TextBox1.SelectionStart = 3
TextBox1.SelectionLength = 1
a = TextBox1.SelectedText
MsgBox(CInt(a & pSplit(3)))
EndSub
Can't find what you're looking for? Ask the community or share your knowledge.