Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 6
mateaus
907 Views, 5 Replies

VBA Robot

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 ?

 

5 REPLIES 5
Message 2 of 6
Artur.Kosakowski
in reply to: mateaus

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.



Artur Kosakowski
Message 3 of 6
mateaus
in reply to: Artur.Kosakowski

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 ?

Message 4 of 6
Rafal.Gaweda
in reply to: mateaus

Hi

 

Try attached file.

(French e with accent replaced by e)

 

Movie attached



Rafal Gaweda
Message 5 of 6
mateaus
in reply to: Rafal.Gaweda

Ok thanks a lot

 

I would like a last thing. 

 

I want to quit robot without saving.

 

Can you give the code in VBA ?

Message 6 of 6
Artur.Kosakowski
in reply to: mateaus

    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.



Artur Kosakowski

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report