ANSYSTM MechanicalTM APDL library

Using version prior to the 15.0 or being ANSYS Classic fan? Our free and open-source macro library will aid you in 3D PDF creation.

PDFPOST macro library

Using our PDFPOST library, you can create pdfPost input files and create 3D PDF’s from APDL environment. Library is free, open-source and will be developed together with pdfPost. You can modify it and use it without any restrictions. You can also share your ideas with us and our users (pdfPost@bpsolutions.com.pl).

Version 1.1 Change log:

  • improved XML generation
  • no “WorkingDirectory” (in accordance with to the pdfPost 1.76)
  • added quickExport method. Equivalent to the one-click-export. Requires only valid ETABLE. Components are based on element types.
zip-icon_download_small
Version 1.0 Basic, first version of the APDLtoPDF library. Recommended for users of pdfPost 1.75 and below, since it generates “WorkingDirectory” XML attribute zip-icon_download_small

Below, you can find some basic examples.

APDLtoPDF v1.1 examples

quickExport example

!loads PDFPOST APDL library
*ulib,APDLtoPDF,lib
!initializes arrays with supported element types ad other internal variables
*use,APDLtoPDF_init
!ANSYS needs to be in /POST1 processor. Result set and ETABLE need to be created manualy
/POST1
SET,1
ETABLE,VONM,S,EQV
!this option will export all geometry and previously defined ETABLE. Components will be created based on defined element types
*use,quickExport,’test’,’VONM’
!unloading PDFPOST library
*ulib

Hide


APDLtoPDF v1.0 examples

Single load case

This example shows, how to export single load case data to pdfPost input files and how to create configuration file. Running this macro will produce the following files:

  • pdfPost_project.elem -> element file
  • pdfPost_project.node -> node file
  • pdfPost_project.cm -> component file
  • pdfPost_project.THICK -> thicknes Etable file
  • pdfPost_project.VONM -> Von Mises Etable file
  • pdfPost_project.USUM -> nodal displacement file
  • pdfPost_project.def -> nodal displacement file (geometry)
  • pdfPost_project.xml -> configuration file
!loads PDFPOST APDL library
*ULIB,APDLtoPDF,lib
!setting project name for most of the files
*use,PDFPOST_setProjectName,’ship’
!creating geometry files
*use,PDFPOST_saveGeometry
!starting XML configuration file
*use,PDFPOST_startXML
!writing components to the configuration file
*use,PDFPOST_writeXMLComp
!writing element types to the configuration file
*use,PDFPOST_writeXMLElems
!loading results for LC1
/POST1
SET,1
!selecting components defined in CompList.txt
*use,PDFPOST_selectComponents
!creating THICKNESS ETABLE
ETABLE,THIC,SMISC,17
!writing ETABLE file
*use,PDFPOST_writeEtable,”,’THICK’
!writing ETABLE plot data to the configuration file
*use,PDFPOST_writeXMLPlot,’Value’
!creating SEQV ETABLE
ETABLE,VONM,S,EQV
!writing ETABLE file
*use,PDFPOST_writeEtable,”,’VONM’
!writing VONM ETABLE plot data to the configuration file
*use,PDFPOST_writeXMLPlot,’Range’
!writing nodal deformation result
*use,PDFPOST_writeNodAvg,”,’USUM’,’U’,’SUM’
!writing USUM plot data to the configuration file
*use,PDFPOST_writeXMLPlot,’Range’
!writing displacement file
*use,PDFPOST_writeUNodes,”
!closing XML configuration file
*use,PDFPOST_endXML
!clearing PDFPOST library variables
*use,PDFPOST_Clear
!unloading PDFPOST library
*ULIB

Two load cases

Running this macro will produce the following files:

  • pdfPost_project.elem -> element file
  • pdfPost_project.node -> node file
  • pdfPost_project.cm -> component file
  • pdfPost_project_LC1.VONM -> load case 1 Von Mises etable file
  • pdfPost_project_LC2.VONM -> load case 2 Von Mises etable file
  • pdfPost_project_LC1.def -> load case 1 nodal displacement file
  • pdfPost_project_LC2.def -> load case 2 nodal displacement file
  • pdfPost_project.xml -> configuration file
*ULIB,APDLtoPDF,lib
*use,PDFPOST_setProjectName,’pdfPost_project’
*use,PDFPOST_saveGeometry
*use,PDFPOST_startXML
*use,PDFPOST_writeXMLComp
*use,PDFPOST_writeXMLElems
*DO,iR,1,2,1
/POST1
SET,iR
*use,PDFPOST_selectComponents
ETABLE,VONM,S,EQV
*use,PDFPOST_writeEtable,’%PDFPOST_projectName%_LC%iR%’,’VONM’
*use,PDFPOST_writeXMLPlot,’Range’
*use,PDFPOST_writeUNodes,’%PDFPOST_projectName%_LC%iR%’
*ENDDO
*use,PDFPOST_endXML
*use,PDFPOST_Clear
*ULIB

Hide