[FEMAP API] Defining a disc drive location as a string
[FEMAP API] Defining a disc drive location as a string
(OP)
Hi,
I've developed a basic api programme to capture and save pictures of output from a modal analysis. The programme orientates a deformed view of the model and saves a view of the graphics window for a defined range of output sets.
I would like the programme to allow the user to define the location that the pictures save to, using a dialogue box, but can't seem to work out how to do this.
Any help would be appreciated!
Alex
I've developed a basic api programme to capture and save pictures of output from a modal analysis. The programme orientates a deformed view of the model and saves a view of the graphics window for a defined range of output sets.
I would like the programme to allow the user to define the location that the pictures save to, using a dialogue box, but can't seem to work out how to do this.
Any help would be appreciated!
Alex





RE: [FEMAP API] Defining a disc drive location as a string
CODE --> WinWrap
GetFilePath$("filename", "JPEG files|*.jpg", "c:\", "Save output pictures", 1)It will return a string with the path, but will not actually create the file (nor the starting folder).
The WinWrap helpfile explains the parameters.
Hope this helps.
RE: [FEMAP API] Defining a disc drive location as a string
try these lines of codes:
Dim RefFileName As String
rc = App.feFileGetName("Give the path and name of the reference picture file","PNG file","*.png",False,RefFileName)
If rc = 2 Then End
RefFileName =Mid(RefFileName,1,InStrRev(RefFileName,"."))
Regards,
Seif Eddine Naffoussi, Stress Engineer
www.Innovamech.com
33650 Martillac û France
RE: [FEMAP API] Defining a disc drive location as a string
For reference, I've ended up using the following:
Dim objShell, objFolder, objFolderItem
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Select folder to write file(s)", &H1)
If objFolder Is Nothing Then
Exit Sub
Else
Set objFolderItem = objFolder.Self
ChDir(objFolderItem.Path)
End If
Set objFolderItem = Nothing : Set objFolder = Nothing : Set objShell = Nothing
I found that by changing the current directory I don't have to define the file path using the feFilePictureSave2 method which makes it easier for me to get the program to automatically name the pictures as it saves them.