In the process of migrating an addin from 2010 to 2013, I've encountered some unusual behavior. Among other things, my addin reports the flat length and width of a sheet metal part. The problem:
In 2010: For sheet metal parts, PartDocument.PropertySets.Item("Design Tracking Properties").Item("Sheet Metal Length").Value.ToString has always returned a string as expected (e.g. "26.065 in").
In 2013: For sheet metal parts, PartDocument.PropertySets.Item("Design Tracking Properties").Item("Sheet Metal Length").Value.ToString sometimes returns a string as expected (e.g. "26.065 in"), and sometimes returns area (e.g. "306.409 in^2") instead.
As I dig into the parts in question, it looks like another property is behaving consistently: PartDocument.PropertySets.Item("Design Tracking Properties").Item("Flat Pattern Length").Value seems to be reliably returning a double of correct value (in internal units--cm).
Besides returning different types, is there a difference by design between these two properties (Flat Pattern Length and Sheet Metal Length)? Is one recommended? Does anyone know what's causing my error? If it helps, I can attach a file.
Solved! Go to Solution.
Solved by alewer. Go to Solution.
I checked Brian Ekins' SheetMetalExtents Addin, which uses FlatPattern.Length and .Width instead. Brian hasn't yet led me astray, so I'll follow this example.
If someone at AD wants to see the behavior described, I've attached a sheet metal part with a VBA document project and a screenshot.