Cancel
Showing results for 
Search instead for 
Did you mean: 

Femap API: Defining a disc drive location as a string

Experimenter
Experimenter

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

2 REPLIES

Re: Femap API: Defining a disc drive location as a string

Phenom
Phenom

Hello,

This might help: the following code will display a folder selection dialog box, then change the current directory to that selected folder.

AP

 

 

'retrieve folder path method
    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
'end folder path method

 

Re: Femap API: Defining a disc drive location as a string

Experimenter
Experimenter

Hi,

 

That works perfectly! Thanks very much.

 

Alex