<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Exporting only solid bodies as STEP file using API in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/exporting-only-solid-bodies-as-step-file-using-api/m-p/7160903#M72942</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am trying to export only solid bodies from a part file into a STEP file using API. But as my file consists of sketches and surfaces along with solids, even the sketches and surfaces are exported along with the solid bodies. Is there anyway to export only the solid, and filter any sketches or surfaces? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code that I am using, which is directly copied from the samples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE&gt;Public Sub ExportToSTEP()
    &lt;SPAN style="color: blue;"&gt;' Get the &lt;FONT color="#ffffff"&gt;STEP&lt;/FONT&gt; translator Add-In.&lt;/SPAN&gt;
    Dim oSTEPTranslator As TranslatorAddIn
    Set oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")

    If oSTEPTranslator Is Nothing Then
        MsgBox "Could not access &lt;FONT color="#ffffff"&gt;STEP&lt;/FONT&gt; translator."
        Exit Sub
    End If

    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
    If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
        
        oOptions.Value("ApplicationProtocolType") = 2

        

        oContext.Type = kFileBrowseIOMechanism

        Dim oData As DataMedium
        Set oData = ThisApplication.TransientObjects.CreateDataMedium
        oData.FileName = "C:\temptest.stp"

        Call oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData)
    End If
End Sub&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Mon, 19 Jun 2017 08:26:16 GMT</pubDate>
    <dc:creator>darryl.menezes</dc:creator>
    <dc:date>2017-06-19T08:26:16Z</dc:date>
    <item>
      <title>Exporting only solid bodies as STEP file using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/exporting-only-solid-bodies-as-step-file-using-api/m-p/7160903#M72942</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am trying to export only solid bodies from a part file into a STEP file using API. But as my file consists of sketches and surfaces along with solids, even the sketches and surfaces are exported along with the solid bodies. Is there anyway to export only the solid, and filter any sketches or surfaces? Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code that I am using, which is directly copied from the samples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE&gt;Public Sub ExportToSTEP()
    &lt;SPAN style="color: blue;"&gt;' Get the &lt;FONT color="#ffffff"&gt;STEP&lt;/FONT&gt; translator Add-In.&lt;/SPAN&gt;
    Dim oSTEPTranslator As TranslatorAddIn
    Set oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")

    If oSTEPTranslator Is Nothing Then
        MsgBox "Could not access &lt;FONT color="#ffffff"&gt;STEP&lt;/FONT&gt; translator."
        Exit Sub
    End If

    Dim oContext As TranslationContext
    Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
    If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
        
        oOptions.Value("ApplicationProtocolType") = 2

        

        oContext.Type = kFileBrowseIOMechanism

        Dim oData As DataMedium
        Set oData = ThisApplication.TransientObjects.CreateDataMedium
        oData.FileName = "C:\temptest.stp"

        Call oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData)
    End If
End Sub&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 19 Jun 2017 08:26:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/exporting-only-solid-bodies-as-step-file-using-api/m-p/7160903#M72942</guid>
      <dc:creator>darryl.menezes</dc:creator>
      <dc:date>2017-06-19T08:26:16Z</dc:date>
    </item>
  </channel>
</rss>

