[Inventor] 使用Inventor iLogic自动将三维图转换成stp格式的文件

JUMU实名认证 发表于 2022-05-05 22:03 | 显示全部楼层 | 复制链接分享      上一主题  翻页  下一主题
使用Inventor iLogic自动将三维图转换成stp格式的文件,代码如下:
  1. ' Get the STEP translator Add-In.
  2. Dim oSTEPTranslator As TranslatorAddIn
  3. oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
  4. Dim oContext As TranslationContext
  5. oContext = ThisApplication.TransientObjects.CreateTranslationContext
  6. Dim oOptions As NameValueMap
  7. oOptions = ThisApplication.TransientObjects.CreateNameValueMap

  8. If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
  9.     ' Set application protocol.
  10.     ' 2 = AP 203 - Configuration Controlled Design
  11.     ' 3 = AP 214 - Automotive Design
  12.     oOptions.Value("ApplicationProtocolType") = 3
  13.     ' Other options...
  14.     'oOptions.Value("Author") = ""
  15.     'oOptions.Value("Authorization") = ""
  16.     'oOptions.Value("Description") = ""
  17.     'oOptions.Value("Organization") = ""
  18.     oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
  19.     Dim oData As DataMedium
  20.     oData = ThisApplication.TransientObjects.CreateDataMedium
  21.     oData.FileName = ThisDoc.PathAndFileName(False) & ".stp"
  22. oSTEPTranslator.SaveCopyAs(ThisApplication.ActiveDocument, oContext, oOptions, oData)
  23. End If
复制代码

  距米网  

找到您想要的设计

工程师、学生在线交流学习平台
关注我们

手机版- 距米网 |苏公网安备32041102000587号

© 2017-2025 居居米 苏ICP备18040927号-1