Impact 2023 (Dynamic Constraints Edition) release is available for download, bringing with it a host of new features. Available here.

Overflow script error

Problem: Overflow script error 

 

Receiving a script error when calculating waste %: Overflow 


Solution 

 

The value mapping issue is caused by the waste % calculation trying to divide by 0 because there is not a closed perimeter.  This can be fixed by replacing or editing the existing waste % mapping in the value mapping referenced above, with the changes/additions in red: 

 

' Waste % 

Set enquire = ActiveLayer.EnquireArea 

 

enquire.Mode = eamOneUps 

enquire.Perform 

If enquire.OutsideArea = 0 then 

   'Cannot divide by 0 

   Result = 0 

Else 

   Result = Round(((enquire.InsideArea/enquire.OutsideArea) * 100),4) 

End If 

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

You may like to read -