Bonjour,
J'aimerais ouvrir un fichier de données en format text avec Robot. J'ai lu le manuel Robot Open Standard (version 3.0) mais je ne parviens pas à utiliser l'objet VBA :
OpenExtFile (file_path : string, format : IRobotExternalFileFormat, ignore_warnings : bool) : bool
Mon fichier texte est sous le format str et se trouve dans W:\Metiers\Ingenieurs\mcorbin\Lgv-BPL\3_LOGICIELS\ROBOT\voute PRA 1197\poussées symétriques k-0.5\don.fic1.str.
Voilà ma macro :
Sub robot_voute()
' ouverture de robot, la session s'appellera robappSet robapp = New RobotApplicationrobapp.Visible = Truerobapp.Interactive = Truerobapp.UserControl = True
' ouverture du fichier textrobapp.OpenExtFile "W:\Metiers\Ingenieurs\XXX\AAA\3_LOGICIELS\ROBOT\voute\poussées symétriques k-0.5\don.fic1.str"
End Sub
Pouvez-vous me la corriger ou me dire comment l'écrire ?
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Try to use:
Sub OpenStrFile()
Dim robApp As New RobotApplication
robApp.Visible = 1
robApp.Interactive = 1
robApp.UserControl = True
robApp.Project.OpenExtFile "c:\don.fic1.str", I_EFF_STR, 1
End Sub
If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.
Ok thank you,
but I have still a problem,
It's opening a project but it's writing me a error of syntaxt :
Erreur :Syntaxe incorrecte - ligne ignorée
I don't undestand because when I open it with the application it's working.
That's the begining of my file text :
ROBOT LGV PRAVBA1197 Pou sym K=0.5 OWN WEIGHT
PORTIQUE PLAN
NUMérotation DIScontinue
NOEUD 45 ELEMENT 46
UNITES
L=M F=kN DEP=MM
NOEUDS 8 -4.3 -1.888
I've attached the text file, (just change extension .txt to .str)
Do you have any idea ?
Hi
Try attached file.
(French e with accent replaced by e)
Movie attached
Ok thanks a lot
I would like a last thing.
I want to quit robot without saving.
Can you give the code in VBA ?
Dim robApp As New RobotApplication
robApp.Quit I_QO_DISCARD_CHANGES
If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.