Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: emanuel.c

Hi @emanuel.c.  Within your 'getstock' function, you are checking 'smCompDef.HasFlatPattern' several lines after you have already attempted to extract data from the FlatPattern with the 'SheetMetal.FlatExtentsLength' & 'SheetMetal.FlatExtentsWidth' lines.  This is obviously not proper logic.  You should be checking for the existence of a FlatPattern before trying to use it or extract data from it.  Then, if not found, either include some code (like Unfold) to create the FlatPattern before trying to access it, or avoid attempting to access it at all.  Because when you try to access/use it, and it doesn't exist yet, it will throw an error.  Just one observation.

 

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)