iLogic - place sheet metal on drawing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I already have a code that allows me to place individual parts onto a .idw. I want to extend the usage of it and therefore I'd like to place multiple sheet metal parts out of a assembly onto the drawing. Each part on a new sheet. Folded parts should be unfolded and then placed. Maybe even in order according to the BOM.
Is it possible to tell Inventor, that the parts should always be in, for example, top-view? I think they are on the flat sourface already, when unfolded. With my code I had the issue, that sometimes parts are build on a different plane and I have to correct it.
Some parts we order folded, because our in house machines can't do it. Is there a way to mark them as laser+fold? Maybe you can put both views onto it's sheet at once. Wouln't be a big deal if this doesn't work.
Then, when on the drawing - can you auto scale all sheets? That way I only need to add dimensions/ comments and can order my parts.
Maybe I just want a little too much, but here's the code I already have 😀
Private Sub Main() 'assume your laser part document is open and active If ThisApplication.Documents.Count=0 OrElse Not ThisApplication.ActiveDocumentType = DocumentTypeEnum.kPartDocumentObject Then MsgBox("This rule can only start with an part document active.", , "iLogic") Exit Sub End If Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument Dim oDrawdoc As DrawingDocument = GetDrawing If oDrawdoc Is Nothing Then MsgBox("Something went wrong getting selected drawing.", , "iLogic") Exit Sub End If 'Call the rule with the drawing view creation Call CreateDrawingView(oDrawdoc, oPartDoc) MsgBox("Done",,"iLogic") End Sub Private Function GetDrawing() As DrawingDocument Dim oFileDlg As Inventor.FileDialog = Nothing InventorVb.Application.CreateFileDialog(oFileDlg) oFileDlg.Filter="Autodesk Inventor-Drawing (*.idw)|*.idw|All Files (*.*)|*.*" oFileDlg.FilterIndex = 1 oFileDlg.DialogTitle = "Open Laser Part Drawing" oFileDlg.CancelError = True On Error Resume Next Err.Clear oFileDlg.ShowOpen() If Not Err.Number = 0 Then Return Nothing End If Dim oDoc As Document For Each oDoc In ThisApplication.Documents If oDoc.FullFileName = oFileDlg.FileName Then GetDrawing =oDoc Return GetDrawing End If Next GetDrawing=ThisApplication.Documents.Open(oFileDlg.FileName) End Function Private Sub CreateDrawingView(ByVal oDrawDoc As DrawingDocument, ByVal oPartDoc As PartDocument) Dim oActiveSheet As Sheet = oDrawDoc.ActiveSheet Dim oSheetSize As DrawingSheetSizeEnum = oActiveSheet.Size Dim oOrientation As PageOrientationTypeEnum = oActiveSheet.Orientation Dim sSheetName As String= System.IO.Path.GetFileNameWithoutExtension(oPartDoc.FullFileName) Dim oWidth As Object = oActiveSheet.Width Dim oHeight As Object=oActiveSheet.Height Dim oSheet As Sheet = oDrawDoc.Sheets.Add(oSheetSize, oOrientation, sSheetName, oWidth, oHeight) oSheet.AddTitleBlock(oActiveSheet.TitleBlock.Definition) oSheet.AddBorder("Brennteil Rahmen") oSheet.Activate Dim oPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width/2, oSheet.Height/2) oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint,1,ViewOrientationTypeEnum.kFrontViewOrientation,DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle ) End Sub
Greets Daniel