I am trying to use iLogic to automatically populate an iProperty value based on the dimensions of the flat patterns. I want the formatting to read as Length X Width. Currently I have the following:
If component_type="standard" Then
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0)" X "Round(extents_length,0)
Else
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0)" X "Round(extents_length,0)
End If
I am getting:
Error on Line 11 : End of statement expected.
Error on Line 13 : End of statement expected.
I'm guessing this is due to using the " X " or having multiple parameters in the same line. If anyone knows the right way to structure this I would appreciate any help you can give.
Also, if there is a way to make these values multiplied by the quantity of parts in an assembly drawing bom to get total stock used that would be very helpful.
EDIT:
Simplified Code:
extents_length = SheetMetal.FlatExtentsLength
extents_width = SheetMetal.FlatExtentsWidth
iProperties.Value("Custom","TOTAL MATERIAL WIDTH")=extents_width
iProperties.Value("Custom","TOTAL MATERIAL LENGTH")=extents_length
iProperties.Value("Custom","TOTAL MATERIAL USED")=extents_width" X " extents_length
Now getting:
Error on Line 5 : End of statement expected.
Solved! Go to Solution.
Solved by Yijiang.Cai. Go to Solution.
Solved by jtylerbc. Go to Solution.
I'm not certain of the syntax to do exactly what you're trying to do. However, I can propose an alternative that may be easier. I believe you can fix this in the custom iProperty itself.
For the value of the TOTAL MATERIAL USED property, type the following iProperty expression:
=<TOTAL MATERIAL WIDTH> X <TOTAL MATERIAL LENGTH>
Then, remove the TOTAL MATERIAL USED line from your iLogic rule altogether.
Generally we need to add the "&" for the string connected. Please see them below -
If component_type="standard" Then
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0) & " X " & Round(extents_length,0)
Else
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0) & " X " & Round(extents_length,0)
End If
That's what I thought and was going to suggest yesterday. Couldn't get it to work at the time - not sure what I was doing wrong then, because it works fine today.
Can't find what you're looking for? Ask the community or share your knowledge.