Wrong output through API when accessing Rangebox Points
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
when saving an part file the saveevent triggers a smal procedure which reads/calculates the dimensions of the flatpattern.
Length = Math.Round(Math.Abs(sheetMetalComponentDefinition.FlatPattern.RangeBox.MaxPoint.X - sheetMetalComponentDefinition.FlatPattern.RangeBox.MinPoint.X), accuracy); Width = Math.Round(Math.Abs(sheetMetalComponentDefinition.FlatPattern.RangeBox.MaxPoint.Y - sheetMetalComponentDefinition.FlatPattern.RangeBox.MinPoint.Y), accuracy); Height = Math.Round(Math.Abs(sheetMetalComponentDefinition.FlatPattern.RangeBox.MaxPoint.Z - sheetMetalComponentDefinition.FlatPattern.RangeBox.MinPoint.Z), accuracy);
With this dimensions I do some check afterwards (f.e. sheetmetal settings are correct).
The height I get when using the calculation above (MaxPoint.Z - MinPoint.Z) is wrong for a more little complex sheet metal parts than flat parts, "standard" boxes (base with four flanges) and so on.
I made some investigations by adding two workpoints to the flatpattern through the API:
WorkPoint workPoint_Z1 = sheetMetalComponentDefinition.FlatPattern.WorkPoints.AddFixed(sheetMetalComponentDefinition.FlatPattern.RangeBox.MaxPoint); WorkPoint workPoint_Z2 = sheetMetalComponentDefinition.FlatPattern.WorkPoints.AddFixed(sheetMetalComponentDefinition.FlatPattern.RangeBox.MinPoint);
I attached some screenshots in the ZIP-File below.
They show a simple box and the corresponding flatpattern with the two inserted Workpoint (through API) - they seem to sit perfectly on the vertices. The 3mm thickness is set correctly and measure tool shows the same. Also if I measure from bottom to top flatpattern face --> 3mm --> all fine!
I also added a little more complex part (2mm thickness is set correctly) and the corresponding flatpattern. As you can see in one of the screenshots the workpoints are off the part/flatpattern-body and away from the vertice where they should sit. Measuring the delta between the workpoints returns NOT the thickness the parts has when checking face to face delta. --> Wrong!
Ok now you say the second parte is a derived one but I also tried a part which looks similar from scratch and with a hole whit the same problem.
Simple question with maybe a difficult answer from your side... Why????
Thank you in advance
BR