Inventor 2016: Import STEP File Component Name

Inventor 2016: Import STEP File Component Name

Anonymous
Not applicable
622 Views
3 Replies
Message 1 of 4

Inventor 2016: Import STEP File Component Name

Anonymous
Not applicable

Hi all,

 

Is there an option in Inventor 2016 to use the actual name of component instead of sequence number in importing STEP file?

 

Kindly refer the attached file.

 

Thank you.

 

0 Likes
623 Views
3 Replies
Replies (3)
Message 2 of 4

wayne.brill
Collaborator
Collaborator

Hi,

 

Are you using the Inventor API or iLogic in this workflow?

 

If this is just using the Inventor default user interface to import a STEP file then the question should be posted on the Inventor General forum:

http://forums.autodesk.com/t5/inventor-general-discussion/bd-p/78

 

If you are using code please provide it so it can be used to recreate and research the problem.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

Anonymous
Not applicable

 

Hi Wayne,

 

Both default user interface and Inventor API have same output.

 

See below of the code in importing STEP file. This program is working in Inventor 2011.

 

Dim oSTEPTranslator As TranslatorAddIn
Dim oContext As TranslationContext
Dim oOptions As NameValueMap
Dim oDataMedium As DataMedium
Dim oTarget As Object
Dim oDoc As Document

Dim i As Integer

For i = 1 To m_InventorApp.ApplicationAddIns.Count
	If m_InventorApp.ApplicationAddIns.Item(i).ClassIdString = "{90AF7F40-0C01-11D5-8E83-0010B541CD80}" Then
		oSTEPTranslator = m_InventorApp.ApplicationAddIns.Item(i)
		Exit For
	End If
Next

If oSTEPTranslator Is Nothing Then
	MsgBox("Could not access STEP translator.")
	Exit Sub
End If

oContext = m_InventorApp.TransientObjects.CreateTranslationContext

oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism

oOptions = m_InventorApp.TransientObjects.CreateNameValueMap

oDataMedium = m_InventorApp.TransientObjects.CreateDataMedium

oDataMedium.FileName = strSTEP

If oSTEPTranslator.HasOpenOptions(oDataMedium, oContext, oOptions) Then
	oOptions.Value("EmbedInDocument") = False

	Call oSTEPTranslator.Open(oDataMedium, oContext, oOptions, oTarget)

	oDoc = oTarget
	oDoc.Views.Add()
End If

Hope you can help.

 

 

Thanks.

0 Likes
Message 4 of 4

wayne.brill
Collaborator
Collaborator

Hi,

 

Thanks for the code example. I am using it to import an .stp I created and I am seeing the component names in the model browser not just numbers. I get this same behavior when opening that step file in the user interface..

 

To create the step file I opened the stapler.iam in the UI and exported it as an step file. (Stapler.iam is one of the default Inventor Samples).

 

Please upload a step file that will allow me to recreate the behavior you are getting. Let me know if you want to send it to me privately.

 

Thanks,

Wayne

 

 



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes