12-04-2020
01:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-04-2020
01:26 PM
you can try this:
Dim doc As PartDocument = ThisDoc.Document Dim def As SheetMetalComponentDefinition = doc.ComponentDefinition If (def.HasFlatPattern) Then def.FlatPattern.Edit() Else def.Unfold() End If Dim flat As FlatPattern = def.FlatPattern Dim sketch As PlanarSketch = flat.Sketches.Add(flat.TopFace, True) sketch.Profiles.AddForSolid() Dim profile As Profile = sketch.Profiles.Item(1) MsgBox("Number of bends: " & def.Bends.Count & System.Environment.NewLine & "Number of profiles (that includes outerprofile): " & profile.Count & System.Environment.NewLine & "Number of breakthroughs: " & profile.Count - 1) 'you don't need this part but might be good to know that it Is possible 'For Each path As ProfilePath In profile ' Dim addMaterial = Path.AddsMaterial ' For Each ent As ProfileEntity In Path ' ' in the ProfileEntities you can find the ' ' Information to calulate the perimeter of the ' ' breakthroughs and the outer perimeter ' Next 'Next sketch.Delete() flat.ExitEdit()
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com