Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey out there.
The picture underneath shows an earliere problem i've posted. It was solved with the code i have posted under the picture (thanks to @JelteDeJong )
Here comes my issue:
I have triggered the code to run after save. But unfortunately this means that all the files that i save will get the "_XX" string in the end.
When I save an assembly it puts "_" after all files.
Is it possible to change the code, so if there's no "_" after the file, it should be left as it is?
E.g
39836_C17 -> code should run.
39836 -> code should NOT run.
I have tried to figure it out myself, without any luck ☹️
Code:
Dim partnumber As String = iProperties.Value("Project", "Part Number") Dim parts = partnumber.Split("_") Dim lastPart = parts(parts.Count() -1) Dim oldDescription As String = iProperties.Value("Project", "Description") Dim descriptionParts = oldDescription.Split("_") Dim descriptionFirstPart = descriptionParts(0) Dim newDescription = String.Format("{0}_{1}",descriptionFirstPart,lastPart) iProperties.Value("Project", "Description") = newDescription
Solved! Go to Solution.