I'd like to build a rule into my standard part template that takes the part number (which it automatically gets from the rilename by default), removes the characters after a delimiter, as well as the delimiter itself, and sets that as a new custom property. For example, we'll call the custom property Prop1
For part 123-321-1.ipt
Inventor already sets part number iProperty to 123-321-1
I want to set Prop1 to 123-321
For part 123-321-25.ipt
Inventor already sets part number iProperty to 123-321-25
I want to set Prop1 to 123-321
Any ideas?
Assumed that there is one custom property named "Prop1" in the template, and please use the code lines below in your iLogic rule -
Temp=Split(iProperties.Value("Project", "Part Number"),"-")(UBound(Split(iProperties.Value("Project", "Part Number"),"-")))
iProperties.Value("Custom", "Prop1")=Left(iProperties.Value("Project", "Part Number"),Len(iProperties.Value("Project", "Part Number"))-Len(temp)-1)
Thanks for the help sir, I was able to take that, modify it a little, and get it to work on my template.
My problem now is, I have this rule running after save document. When I saved the template, it ran the rule and set the property. Now when I create a new part with that template, it still has the Prop1 value from the template, not from the new part. How do I make it overwrite the value again?
Really glad to know this could be helpful for you
Can't find what you're looking for? Ask the community or share your knowledge.