Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Reading beginning of Filename

1 REPLY 1
SOLVED
Reply
Message 1 of 2
djgrooster
771 Views, 1 Reply

iLogic Reading beginning of Filename

I'm attempting to create a rule using iLogic, which reads the first two letters of either the File Name or Part number (Which ever is easier)

i.e. if a part number was AB12345, I would want the code to recognize the "AB"

At which point I'm trying to use an If-Then-Else statement to modifiy the material of the part, dependent on the first two characters of the File name.

Is this possible?

 

As an example, where the underlined portion is what i don't know how to code:
If  iProperties.Value("Project", "Part Number") Begins with "AB" Then
    iProperties.Material = "Steel"
Else If iProperties.Value("Project", "Part Number") Begins with "AC" Then
    iProperties.Material = "Aluminum"
End If

 

Thanks
-Dan

Tags (1)
1 REPLY 1
Message 2 of 2
djgrooster
in reply to: djgrooster

I Figured this one out i went with
If Left(iProperties.Value("Project", "Part Number"),2)= "AB" Then
    iProperties.Material = "Steel"
Else If Left(iProperties.Value("Project", "Part Number"),2)= "AC" Then
    iProperties.Material= "Aluminum"
End If

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

Post to forums  

Autodesk Design & Make Report