Hi folks
how can I get the importer Index and associated fileextension (e.g. ".step")
or a list of all importer indexes and the associated fileextensions
IDocuments.ImportWithOptions Method
Moderators: remi77, jacs, Daniel
-
- Master Corporal
- Posts: 39
- Joined: Fri Oct 02, 2009 9:46 am
- TopSolid Module: TopSolid'Cam
- TopSolid Version: 7.8
- Location: Germany
IDocuments.ImportWithOptions Method
Last edited by cam on Wed May 31, 2017 11:35 am, edited 1 time in total.
Greetings
Chris
Chris
- JuP
- Major
- Posts: 169
- Joined: Tue Sep 09, 2014 5:45 pm
- TopSolid Module: TopSolid'Steel
- TopSolid Version: 7.14
Re: IDocuments.ImportWithOptions Method
Hi,
You have to scan all importer and research step.
Example of code for importer searching:
"Extension" is juste a string with wich contains your extension like that:
After that you have to use keyvalues for choose importer options, other example:
I hope this was helpful
You have to scan all importer and research step.
Example of code for importer searching:
Code: Select all
'Importer searching (Ok)
Dim Importer As Integer
Try
For i = 0 To 50
Dim ExitFor As Boolean
Dim FileTypeName As String = ""
Dim FileExtensions As String() = Nothing
TopSolidHost.Application.GetImporterFileType(i, FileTypeName, FileExtensions) 'Importers getting
For Each FileExension As String In FileExtensions 'For each importer found
FileExension = FileExension.ToUpper()
Extension = Extension.ToUpper()
If FileExension = Extension Then 'If active importer correspond
Importer = i
ExitFor = True
Exit For
End If
Next
If ExitFor = True Then
Exit For
End If
Next
Catch ex As Exception
MsgBox("Aucun importer trouvé")
Me.Close()
Exit Function
End Try
Code: Select all
Dim Extension As String = ".step"
Code: Select all
Dim ImporterOptions As New List(Of KeyValue)
Dim KeyValueImplemented As New KeyValue
KeyValueImplemented.Key = "TRANSLATES_ATTRIBUTES"
KeyValueImplemented.Value = "True"
ImporterOptions.Add(KeyValueImplemented)
KeyValueImplemented.Key = "SIMPLIFIES_GEOMETRY"
KeyValueImplemented.Value = "False"
ImporterOptions.Add(KeyValueImplemented)
KeyValueImplemented.Key = "TRANSLATES_FREE_CURVES"
KeyValueImplemented.Value = "True"
ImporterOptions.Add(KeyValueImplemented)
KeyValueImplemented.Key = "TRANSLATES_FREE_SURFACES"
KeyValueImplemented.Value = "True"
ImporterOptions.Add(KeyValueImplemented)
KeyValueImplemented.Key = "TRANSLATES_HIDDEN_ENTITIES"
KeyValueImplemented.Value = "True"
ImporterOptions.Add(KeyValueImplemented)
-
- Master Corporal
- Posts: 39
- Joined: Fri Oct 02, 2009 9:46 am
- TopSolid Module: TopSolid'Cam
- TopSolid Version: 7.8
- Location: Germany
Re: IDocuments.ImportWithOptions Method
Bonjour Julien,
yes this is very helpful
Merci beaucoup
yes this is very helpful
Merci beaucoup
Greetings
Chris
Chris