Message 1 of 2
Not applicable
10-21-2014
11:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Public Sub SendIGES()
' Get the IGES translator Add-In.
Dim oIGESTranslator As TranslatorAddIn
Set oIGESTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F44-0C01-11D5-8E83-0010B541CD80}")
Dim oContext As TranslationContext
Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
Dim oData As DataMedium
Set oData = ThisApplication.TransientObjects.CreateDataMedium
Dim i As Long 'Counter for For loop
Dim oAssyDoc As AssemblyDocument
Set oAssyDoc = ThisApplication.ActiveDocument
Dim oAssyCompDef As AssemblyComponentDefinition
Set oAssyCompDef = oAssyDoc.ComponentDefinition
Dim oPartDoc As PartDocument
Dim oPartCompDef As PartComponentDefinition
oContext.Type = kFileBrowseIOMechanism
Dim oOcc As ComponentOccurrence
i = 1
For Each oOcc In oAssyCompDef
Set oPartDoc = oAssyCompDef.Occurrences.Item(i)
Set oPartCompDef = oPartDoc.ComponentDefinition
oData.FileName = "C:\Users\JBL09\Desktop\iges test\Temptest_" & i & ".igs"
Call oIGESTranslator.SaveCopyAs(oPartCompDef, oContext, oOptions, oData)
i = i + 1
Next
End SubI have this code to try to export an iges file for each part in an assy. However, I get an error when the code tries to run the For loop. What gives?
Solved! Go to Solution.