- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, friends from the forum.
Nowadays I´m using the following piece of code to obtain a rough approx amount of sheet metal needed to produce a given piece. Then that amount in sqm in written to a custom iprop.
iProperties.Value("Custom", "G_M2") = (Strings.FormatNumber((Round(SheetMetal.FlatExtentsLength)*((SheetMetal.FlatExtentsWidth))),0,,,0))/1000000
What I want to do next is to place it in a custom sheet metal template for pieces designed from scratch, but the problem with this method is that the above instruction returns error until the flat pattern is developed.
A) Help I need is for a conditional behaviour of the code that avoid the fail message:
1) Before obtaining the calculation, check If flat pattern is developed.
2) if it does no, then Custom iproperty = "0"
3) if it does exist, write the resultant calc from the above code.
Else
B) A message box to be triggered before file is closed , that in case of exiting before flat pattern is developed warns about the fact that no area will be calculated without it.
Thanks for your patience.
Solved! Go to Solution.