Quantcast

run python file from abaqus cmd

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

run python file from abaqus cmd

zemzemi farhat

  Dear Madam/Sir
   
  I' m trying to run a python file from abaqus command in order to write some output values from an existing odb file in text file, but I don't know how to do this.
   
  the python file text is as following
   
  ************************************************************************
  # Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
  def farhatpython():
    import part
    import regionToolset
    import displayGroupMdbToolset as dgm
    import material
    import section
    import assembly
    import step
    import interaction
    import load
    import mesh
    import job
    import sketch
    import visualization
    import xyPlot
    import displayGroupOdbToolset as dgo
    odb = session.odbs['C:/Documents and Settings/Administrateur/Bureau/traing/job1.odb']
    session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('U',
        NODAL, ((COMPONENT, 'U1'), )), ), steps=('Step-1', ), nodePick=((
        'PART-2-2', 1, ('[#0 #100000 ]', )), ), )
    x0 = session.xyDataObjects['U:U1 PI: PART-2-2 N: 53-2']
    session.writeXYReport(
        fileName='C:/Documents and Settings/Administrateur/Bureau/traing/fich3.txt',
        xyData=(x0, ))  
  ***********************************************************************************************
  Actually, I have used the following command:
   
  'C:/Documents and Settings/Administrateur/Bureau/traing/abaqus python AbaqusMacros.py'
   
  Thank you for your help
   
  Sincerly yours
   


        ----------------------------------------------
ZEMZEMI FARHAT
LGM -ENIM www.lgm.rnu.tn
Avenue Ibn Aljazzar 5019 Monastir Tunisie
Tél portable (00216) 97 85 75 93
  LTDS ENI Saint Etienne
58 Rue Jean Parot – 42000 Saint-Etienne - France
Tél.(portable) (0033) (0) 6 98 63 64 05
  Tél.(bureau) (00 33) (0) 4 77 43 75 42
[hidden email]
[hidden email]





 
---------------------------------
 Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. Cliquez ici.

[Non-text portions of this message have been removed]






Community email addresses:
  Post message: [hidden email]
  Subscribe:    [hidden email]
  Unsubscribe:  [hidden email]
  List owner:   [hidden email]

Shortcut URL to this page:
  http://groups.yahoo.com/group/abaqus 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ABAQUS/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: run python file from abaqus cmd

Eric Sun
Hi, ZEMZEMI,

When you use ABAQUS python any.py at the system prompt, you can not
use any of the ABAQUS/CAE modules. It seems to me that you did use the
visualization module, which means that your script will fail because
of that. Also, I feel that there is no need to import every modules
under the sun. Just import whatever is necessary.

It is always safe to run script from ABAQUS/CAE. File -> Run Script.
Try this method.

Good luck.

Eric Sun
Yorktown, Virginia, USA



--- In [hidden email], zemzemi farhat <farhatbenoth@...> wrote:
>
>
>   Dear Madam/Sir
>    
>   I' m trying to run a python file from abaqus command in order to
write some output values from an existing odb file in text file, but I
don't know how to do this.
>    
>   the python file text is as following
>    
>  
************************************************************************

>   # Do not delete the following import lines
> from abaqus import *
> from abaqusConstants import *
>   def farhatpython():
>     import part
>     import regionToolset
>     import displayGroupMdbToolset as dgm
>     import material
>     import section
>     import assembly
>     import step
>     import interaction
>     import load
>     import mesh
>     import job
>     import sketch
>     import visualization
>     import xyPlot
>     import displayGroupOdbToolset as dgo
>     odb = session.odbs['C:/Documents and
Settings/Administrateur/Bureau/traing/job1.odb']
>     session.xyDataListFromField(odb=odb, outputPosition=NODAL,
variable=(('U',
>         NODAL, ((COMPONENT, 'U1'), )), ), steps=('Step-1', ),
nodePick=((
>         'PART-2-2', 1, ('[#0 #100000 ]', )), ), )
>     x0 = session.xyDataObjects['U:U1 PI: PART-2-2 N: 53-2']
>     session.writeXYReport(
>         fileName='C:/Documents and
Settings/Administrateur/Bureau/traing/fich3.txt',
>         xyData=(x0, ))  
>  
***********************************************************************************************

>   Actually, I have used the following command:
>    
>   'C:/Documents and Settings/Administrateur/Bureau/traing/abaqus
python AbaqusMacros.py'

>    
>   Thank you for your help
>    
>   Sincerly yours
>    
>
>
>         ----------------------------------------------
> ZEMZEMI FARHAT
> LGM -ENIM www.lgm.rnu.tn
> Avenue Ibn Aljazzar 5019 Monastir Tunisie
> Tél portable (00216) 97 85 75 93
>   LTDS ENI Saint Etienne
> 58 Rue Jean Parot – 42000 Saint-Etienne - France
> Tél.(portable) (0033) (0) 6 98 63 64 05
>   Tél.(bureau) (00 33) (0) 4 77 43 75 42
> farhatbenoth@...
> zemzemi@...
>
>
>
>
>
>  
> ---------------------------------
>  Découvrez un nouveau moyen de poser toutes vos questions quelque
soit le sujet ! Yahoo! Questions/Réponses pour partager vos
connaissances, vos opinions et vos expériences. Cliquez ici.
>
> [Non-text portions of this message have been removed]
>









Community email addresses:
  Post message: [hidden email]
  Subscribe:    [hidden email]
  Unsubscribe:  [hidden email]
  List owner:   [hidden email]

Shortcut URL to this page:
  http://groups.yahoo.com/group/abaqus 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ABAQUS/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE : Re: run python file from abaqus cmd

zemzemi farhat
Hi,Eric
   
  Thanks,
   
  Have you any information about the python commads (.psf file exemple)  used to execute an inp file and read somes results from odb file.
   
  Sincerly yours
   
 

Eric Sun <[hidden email]> a écrit :
          Hi, ZEMZEMI,

When you use ABAQUS python any.py at the system prompt, you can not
use any of the ABAQUS/CAE modules. It seems to me that you did use the
visualization module, which means that your script will fail because
of that. Also, I feel that there is no need to import every modules
under the sun. Just import whatever is necessary.

It is always safe to run script from ABAQUS/CAE. File -> Run Script.
Try this method.

Good luck.

Eric Sun
Yorktown, Virginia, USA

--- In [hidden email], zemzemi farhat <farhatbenoth@...> wrote:
>
>
> Dear Madam/Sir
>
> I' m trying to run a python file from abaqus command in order to
write some output values from an existing odb file in text file, but I
don't know how to do this.
>
> the python file text is as following
>
>
************************************************************************

> # Do not delete the following import lines
> from abaqus import *
> from abaqusConstants import *
> def farhatpython():
> import part
> import regionToolset
> import displayGroupMdbToolset as dgm
> import material
> import section
> import assembly
> import step
> import interaction
> import load
> import mesh
> import job
> import sketch
> import visualization
> import xyPlot
> import displayGroupOdbToolset as dgo
> odb = session.odbs['C:/Documents and
Settings/Administrateur/Bureau/traing/job1.odb']
> session.xyDataListFromField(odb=odb, outputPosition=NODAL,
variable=(('U',
> NODAL, ((COMPONENT, 'U1'), )), ), steps=('Step-1', ),
nodePick=((
> 'PART-2-2', 1, ('[#0 #100000 ]', )), ), )
> x0 = session.xyDataObjects['U:U1 PI: PART-2-2 N: 53-2']
> session.writeXYReport(
> fileName='C:/Documents and
Settings/Administrateur/Bureau/traing/fich3.txt',
> xyData=(x0, ))
>
***********************************************************************************************

> Actually, I have used the following command:
>
> 'C:/Documents and Settings/Administrateur/Bureau/traing/abaqus
python AbaqusMacros.py'

>
> Thank you for your help
>
> Sincerly yours
>
>
>
> ----------------------------------------------
> ZEMZEMI FARHAT
> LGM -ENIM www.lgm.rnu.tn
> Avenue Ibn Aljazzar 5019 Monastir Tunisie
> Tél portable (00216) 97 85 75 93
> LTDS ENI Saint Etienne
> 58 Rue Jean Parot – 42000 Saint-Etienne - France
> Tél.(portable) (0033) (0) 6 98 63 64 05
> Tél.(bureau) (00 33) (0) 4 77 43 75 42
> farhatbenoth@...
> zemzemi@...
>
>
>
>
>
>
> ---------------------------------
> Découvrez un nouveau moyen de poser toutes vos questions quelque
soit le sujet ! Yahoo! Questions/Réponses pour partager vos
connaissances, vos opinions et vos expériences. Cliquez ici.
>
> [Non-text portions of this message have been removed]
>



         


        ----------------------------------------------
ZEMZEMI FARHAT
LGM -ENIM www.lgm.rnu.tn
Avenue Ibn Aljazzar 5019 Monastir Tunisie
Tél portable (00216) 97 85 75 93
  LTDS ENI Saint Etienne
58 Rue Jean Parot – 42000 Saint-Etienne - France
Tél.(portable) (0033) (0) 6 98 63 64 05
  Tél.(bureau) (00 33) (0) 4 77 43 75 42
[hidden email]
[hidden email]





 
---------------------------------
 Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. Cliquez ici.

[Non-text portions of this message have been removed]






Community email addresses:
  Post message: [hidden email]
  Subscribe:    [hidden email]
  Unsubscribe:  [hidden email]
  List owner:   [hidden email]

Shortcut URL to this page:
  http://groups.yahoo.com/group/abaqus 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ABAQUS/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Loading...