Autodesk Inventor
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Create flat pattern idws from an assembly
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
361 Views, 1 Replies
03-15-2012 08:08 AM
To increase the speed of production, I like to generate idws of flat patterns from assembly. The following iLogic rule work fine inside a metal sheet (I had to create flat pattern before run this rule).
Imports Inventor.ViewOrientationTypeEnum Imports Inventor.DrawingViewStyleEnum Dim oDrawingDoc As DrawingDocument Dim oPartDoc As Document Dim oSheet As sheet Dim oTG As TransientGeometry Dim oView1 As DrawingView Dim oOptions As NameValueMap oPartDoc = ThisApplication.ActiveDocument oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObject, "C:\Users\Public\Documents\Autodesk\Inventor 2011\Templates\Standard.IDW", True) oSheet = oDrawingDoc.Sheets.Item(1) oOptions = ThisApplication.TransientObjects.CreateNameValueMa p oOptions.Add("SheetMetalFoldedModel", False) oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(15 #, 15#) oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, 1/5#, kDefaultViewOrientation, kHiddenLineDrawingViewStyle, , , oOptions)
But from an assembly there are some problem ( firstable I'm not an expert of vba and ilogic)
Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum
fmgr = ThisApplication.Filemanager
For Each file In fmgr.files
doc = ThisApplication.Documents.ItemByName (file.fullfileName)
compdef = doc.ComponentDefinition
' For each assembly or subassembly
'If (doc.documenttype = 12291) Then
For Each occ In compdef.Occurrences
' For sheet metal or part
If (occ.definition.type =83886592) Then
' If (occ.definition.Subtype ="{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}") Then
Dim oDrawingDoc As DrawingDocument
Dim oPartDoc As Document
Dim oSheet As sheet
Dim oTG As TransientGeometry
Dim oView1 As DrawingView
Dim oOptions As NameValueMap
oPartDoc = ThisApplication.ActiveDocument
oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObje ct, "C:\Users\Public\Documents\Autodesk\Inventor 2011\Templates\Standard.IDW", True)
oSheet = oDrawingDoc.Sheets.Item(1)
oOptions = ThisApplication.TransientObjects.CreateNameValueMa p
oOptions.Add("SheetMetalFoldedModel", False)
oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(15 #, 15#)
oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint1, 1/5#, kDefaultViewOrientation, kHiddenLineDrawingViewStyle, , , oOptions)
' MessageBox.Show("test1")
' Else
' MessageBox.Show("test2")
End If
Next occ
'End If
Next file
Can someone help me?
Re: Create flat pattern idws from an assembly
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-15-2012 08:51 AM in reply to:
MatteoC
i guess you have to open sheet metal part before create its drawing document.
