×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

[FEMAP API] Defining a disc drive location as a string

[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

RE: [FEMAP API] Defining a disc drive location as a string

If you don't mind the dialog asking for confirmation to create the file, you can use the following:

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

Hi,

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

(OP)
Thanks for the help! I've managed to get both of these suggested methods to work.

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

eBook - 10 Reasons to Choose CATIA on the Cloud
To compete in today’s fast-paced and competitive market, smaller and newer firms need a powerful platform that will enable them to compete with bigger players, without the heavy investments needed in computer hardware, software and personnel. Download Now
White Paper - Smart Manufacturing for Electronics
This white paper describes a transformative approach to electronics manufacturing made possible by the addition of Mentor Graphics to the Siemens family. It describes a completely digitalized strategy that supports both printed circuit board (PCB) and mechanical design and manufacturing, uniting the entire product lifecycle – from idea and production to customers and back. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close