OK. Actually the last 4 lines of code there look suspicious.
In the fourth and third from last lines there, you are using an If...End If statement, but there is no 'Then' keyword used at the end of the If line...which indicates to me that you are just trying to 'set' the value of that iProperty, and not 'checking' the value of that iProperty.
If your intention there is to 'set' its value, then:
- remove the 'If' from the start of that line of code, then also delete the 'End If' from the next line.
If your intention there was to 'check' the value, then:
- After the "= sPartNumber" portion should be the keyword "Then" after a single space
- There would be another line of code (or multiple more lines) between the 'If' and the 'End If', where you do something, depending on if the value matched what you are comparing it to.
Then again, with the last two lines shown there, similar situation, but worse.
The next to last line starts with 'If', but I do not see anything later within that line of code where you are checking anything, such as if the value equals something, to see if it is True. The last line is just 'End If', which would be OK, if there was something 'checked' within the 'If' portion in the line before that, and there was some extra code reacting to the result of that test.
Are you trying to 'set' the value of that iProperty there, or are you checking something there? I can't tell.
It kind of looks like you intended to set the value of the Description iProperty, but if that is the case, then several things would have to change there.
If trying to 'set' the value of that iProperty, then:
- remove 'If' from the front of that line of code
- insert "=" symbol (unquoted) between ["Description")] and the rest that follows it
- Include the & symbol between each of those 3 Strings you are trying to join together into one String
- remove your comment after that point (where it says "(this is line 261)")
- Delete the 'End If' from the last line
Wesley Crihfield

(Not an Autodesk Employee)