Thank you Deepak for your answer.
But... it's very close to what i'm looking for.
The differents is:
I want to export the model to a drawing name and not to the model name. (We save the model name different from our drawing name).
and the directory to place is on a temporarely directory and not the same as where the model is.
Alex, that macro is just a start and you can always modify the codes to requirements.
I know Deepak,
I've managed to change the save as function. The STEP file name is now the same as drawing name. Next step is to place the files into a temporarely directory. I'm getting to a good solution.
Hopely it will work with files were we have several configuration in 1 drawing. Like a welding drawing
You can set it to open the configuration referred by the view.
Ok, I'm back to business.
My next question/project:
I need a macro (or start with it) that can open a drawing using a list (TXT file).
When opening the drawing, look for the referenced model. If the model consist out of an assembly, open the assembly (or all parts seperatly if that's possible) and create from all the parts (no configuration) a STEP file and saving the individual parts in a temporarely folder with the name of the drawing and a extension of the part name.
I have drawing named 001-pk001-01(.slddrw)
The referenced model name is 'pk001 frame' .(sldasm).
The model consist out of 3 parts, 'pk001 tube 1' (.sldprt), 'pk001 tube 2' (.sldprt) and 'pk001 tube 2' (.sldprt),
From the parts I need STEP file saving under the name: 001-pk001-01 tube 1 (.STEP), 001-pk001-01 tube 2 (.STEP), 001-pk001-01 tube 3 (.STEP)
So open the first part in the assy and export a STEP file close the part and open the next part.
You can read the contents of a TXT file using the following example:
Dim sTextLines(0 To 100) As String 'Although it's better to allocate the size dynamically
Dim sTXTFilePath as string
sTXTFilePath = "C:/" 'Add your file location and name here
Open sTXTFilePath For Input As #1
i = 0
Do Until EOF(1)
Line Input #1, sTextLines(i)
i = i + 1
The last line that is read will be empty.
You might have to add "Microsoft Scripting Runtime" to you SW references, but only do that is you get error messages that you are using wrong file formats or things like that. I think I needed to do that when I was creating a file, not reading from one.