Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Removing Characters from Part Number

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
GosponZ
445 Views, 2 Replies

Removing Characters from Part Number

I posted this question and i got perfect answer. Code is still working but i want to upgrade rule. I wish to remove more then "-" from part number. I need one more character to remove. (".")I beleive it is not to hard . Here is code

 

If booleanParam = True Then

        Dim PartNumber As String = iProperties.Value("Project", "Part Number")

        iProperties.Value("Custom", "Program") = PartNumber.Replace("-", "")

Else

        booleanParam = False

        iProperties.Value("Custom", "Program") = ""

 

Thank you

2 REPLIES 2
Message 2 of 3
rjay75
in reply to: GosponZ

Just add the  same type of replacement you have the the "-". You can 'chain' them together.

 

 

If booleanParam = True Then

        Dim PartNumber As String = iProperties.Value("Project", "Part Number")

        iProperties.Value("Custom", "Program") = PartNumber.Replace("-", "").Replace(".","")

Else

        booleanParam = False

        iProperties.Value("Custom", "Program") = ""

Message 3 of 3
GosponZ
in reply to: rjay75

Thanks,

i missed dot, .Replace and that is why i had problem.

Again Thank you for help

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report