Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am looking for code that will run in assembly and it will loop through all parts and for bent plates will read SheetMetal.FlatExtentsLength and SheetMetal.FlatExtentsWidth.
I have a problem to get from assembly level to Part sheetmetal.
Sub main Dim oAssDoc As AssemblyDocument = ThisDoc.Document Dim oDoc As Document Dim BoxLength, BoxWidth As Double For Each oDoc In oAssDoc.AllReferencedDocuments If oDoc.DocumentType = kPartDocumentObject And oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'sheet metal part' Dim dir1 As Double = SheetMetal.FlatExtentsLength 'oDoc.SheetMetal.FlatExtentsLength ? Dim dir2 As Double = SheetMetal.FlatExtentsWidth 'oDoc.SheetMetal.FlatExtentsWidth ? Dim lengths As New List(Of Double) From {dir1, dir2} lengths.Sort BoxWidth = lengths(0) BoxLength = lengths(1) Trace.Write("oDoc: " & oDoc.DisplayName) Trace.Write("BoxWidth: " & BoxWidth) Trace.Write("BoxLength: " & BoxLength) End If Next End Sub
Solved! Go to Solution.