Message 1 of 2
2017 - SheetMetal Extents Properties

Not applicable
04-12-2018
05:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am currently working on an add in that iterates through an assembly and creates various drawings. A useful parameter for this is the sheetmetal extents for the flatpattern drawings. This is easy enough to get when working with a sheetmetal part file but when I try to drill down from the assembly file I can't seem to get at it. EG
SyntaxEditor Code Snippet
'SCALE DXF ACCORDING TO BLANK EXTENTS'*******************************************************************************************************************************'* Find out if it is a sheetmetal part'***************************************************************************************************************************** ' Make sure the document is a sheet metal document. If docFile.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then MessageBox.Show( "Not a sheetmetal part so no flat pattern", "Sheetmetal") Else Dim oCompDef As SheetMetalComponentDefinition oCompDef = docFile.ComponentDefinition '***********CREATE THE FLATPATTERN ' Create a new NameValueMap object extents_length = oCompDef.SheetMetal.FlatExtentsLength extents_width = oCompDef.SheetMetal.FlatExtentsWidth MessageBox.Show("Sheetmetal extents are:-" & extents_length & "x" & extents_width, "Title") Dim oCurve As DrawingCurve Dim oBaseViewOptions As NameValueMap oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap DrawingViewScale = 0.2 'True = folded view 'False = flat pattern view oBaseViewOptions.Add("SheetMetalFoldedModel", False) oPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(9, 15) oFlatView = oSheet.DrawingViews.AddBaseView(docFile, oPoint3, DrawingViewScale, kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle,,, oBaseViewOptions) MessageBox.Show("Flatpattern Created at Scale " & DrawingViewScale, "Title") '*********************************************' Add bend notes For Each oCurve In oFlatView.DrawingCurves If oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _ Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge Then ' Create the bend note oBendNote = oSheet.DrawingNotes.BendNotes.Add(oCurve) End If
The variables "extentslength" and "extentswidth" remain = 0
What is the correct syntax for getting this data for each sheetmetal part?
Thanks
Richard