Macros

  • a2comet.mac

    Fern Thomassy (Southwest Research Institute)

    Creates a COMET/Acoustics model from an ANSYS model.

  • a2glue.mac

    Eric Miller (PADT)

    Work around for standard AGLUE that avoids the "ungluing"that can occur

  • a_filmax.mac

    Ernst Hustedt (Air New Zealand Engineering)

    Calculate maximum possible fillet radius for lines 1 and 2 and store in variable FILMAX.

  • a_hydro1.mac

    Ernst Hustedt (AMES Ltd.)

    "I wrote a macro years ago to calculate distributed loads. The idea behind it is to define a profile using 3-noded shells above the surface to be loaded and calculate the height of the profile above each node of the surface. The nodal force is the height calculated for each node. In a second macro the point loads are scaled proportionally to the area associated with each node. I guess ANSYS has some better functionality now to do this sort of thing. I add the code for what it's worth. It did the job for me at the time."

    For A_HYDRO1 (part 1 of 2), this is a macro to calculate hydrostatic loads under an arbitrary profile. The procedure involves calculating the vertical distance from each point to be loaded to a ceiling of arbitrary shape, where the ceiling is defined by triangular patches.

  • a_hydro2.mac

    Ernst Hustedt (AMES Ltd.)

    "I wrote a macro years ago to calculate distributed loads. The idea behind it is to define a profile using 3-noded shells above the surface to be loaded and calculate the height of the profile above each node of the surface. The nodal force is the height calculated for each node. In a second macro the point loads are scaled proportionally to the area associated with each node."I guess ANSYS has some better functionality now to do this sort of thing. I add the code for what it's worth. It did the job for me at the time."For A_HYDRO2, this is a macro to modify nodal forces calculated in A_HYDRO1.MAC proportionally to their areas.

  • a_num.mac

    Mitch Voehl (CEC Corp)

    Macro to get area number by keypoint number.

  • ac_angle.mac

    Mike Yaksh (NAC Int'l)

    Combines the real and imaginary components for a given load set to obtain the field at a specified electrical angle. This will only combine the nodal data and the SMISC element table items. For the NMISC element table items, use ac_anget.mac

  • acal.mac

    (Tech Inno)

    This macro calculates the sum of areas for all selected elements. Macro amended by S. Kukula (Dyson Ltd) with *VMASK to account for non-consecutive area numbering.

  • accurate.zip

    Vladimir Tkach (NPO Energomash)

    "This macro evaluate Mesh Discretization Error and Criteria for Accuracy of Finite Element Solutions based on Chandresh Shah’s article (2002)."

  • acmn.mac

    Eric Miller (PADT)

    Looks for and then plots and lists any areas shared by two volumes

  • acomplot.mac

    Eric Miller (PADT)

    Finds any areas that are shared by the selected set of volumes and plots them. Useful to check VGLUEs

  • aext.mac

    Juha Tyllinen (KONE Corporation)

    This macro creates an area by 'extruding' line - Similar to ANSYS command VEXT.

  • aface.mac

    John Crawford (Honeywell)

    If you want to use this macro to create areas on the outside skin of tet elements, use the ESURF command to create shell elements on the outside faces of the tets, then select these shell elements and run AFACE.MAC.

  • aloop.mac

    Stefano Lucarelli (Mannesmann VDO AG)

    This input file asks for selection of one or more areas and loops until all areas directly or indirectly connected to the original ones are selected then plots them

  • alsm.mac

    John Crawford (Honeywell)

    I ended up writing a macro that selects/reselects/unselects meshed areas, and then copied it and modified it for doing the same with volumes.

  • anfout.mac

    John Swanson (SAS, Inc./ANSYS, Inc.)

    Macro that traverses the solid model and writes an anf file.
    Posted by Eric Miller (PADT)

  • anfout2.mac

    John Swanson (SAS, Inc./ANSYS, Inc.), slightly modified by John Crawford (Honeywell)

    Macro that traverses the solid model and writes an anf file. Modified by John Crawford to include not just highest level component (i.e., write both volumes and 'free' areas which are selected).

  • anglemod.mac

    John Crawford (Honeywell)

    From ANSYS Solutions article "Big Insights from Small Macros", Vol. 2 No. 1 pg. 27. Generates a cantilever beam to determine required elements per fillet for modeling studies

  • anharm.mac

    Bill Bulat (CSI)

    Animates pressure results of harmonic analysis in /POST1 by contouring the real part of the solution while varying the phase angle. (While 5.6 has the feature, I like the way Bill has implemented this -- take a look: it's a bit more efficient than the 5.6 macro - STI)

  • anol.mac

    Bram Weisman (SBM-IMODCO)

    "I wrote some macros to simplify common annotation tasks. They let me place annotation on the screen n lines above the title. This eliminates picking and placement guesswork. Below is the one that places annotation on the left side. Initially, I only had one argument for the actual text (arg3). Then I realized that the /tlab command allows up to 60 characters, but currently only 32 get passed through as arguments to macros. So I added a second one (arg4).
    "Generally for ANOL, I won't use the second argument (the character offset). If you use a zero for ARG1, your text will precisely overlay the /title and I believe this is independent of screen resolution, but might be dependent on certain other text settings.
    "To get a feel for this, try issuing the following:
    ANOL,4,,'This is four lines above title',''
    ANOL,3,,'This is three lines above title',''
    ANOL,2,,'This is two lines above title',''
    ANOL,1,,'This is one lines above title',''

    "Also try the following:
    /title,This is the title
    ANOL,0,,'This is the title',''

    The two are perfectly overlaid on my system."

  • ans2aba.mac

    Dave Lindeman (3M)

    This macro (actually, an input file of an ABAQUS verification problem) provides an example of using ANSYS to preprocess and write out an ABAQUS input deck. From the author: "Note that this is an APDL script that illustrates a translation procedure and NOT an independent macro (i.e., this is just a starting place for others -- customization IS required)."

  • ans2pat.mac

    Gordon May (Rolls Royce Compressor Key System)

    ANSYS to Patran 2 Neutral File translator: this macro translates element and nodal data FOR THE CURRENTLY SELECTED SET OF ELEMENTS into Patran 2 Neutral File (PNF) format.

  • ans2unv.mac

    Rogelio Perez (Schneider Electric Industries SAS)

    This macro translates element and nodal data FOR THE CURRENTLY SELECTED SET OF ELEMENTS into Ideas Neutral File (UNV) format. Based on the Ansys to Patran 2 macro developed by G. May and available in ansys.net

  • ansys2stl.mac

    Iker Gómez Vázquez (ITP)

    This is a macro to convert an ANSYS structural mesh into an ASCI STL (stereolithography) file.

    Since the STL format is based on a triangular surface mesh, this macro selects all external nodes, generates SURF154 elements, then exports these to the STL file.

    Macro updated on 03/17/2009.

  • anvect.mac

    Bill Bulat (CSI)

    Animates velocity vectors from Flotran transient results

  • anvolt.mac

    Bill Bulat (CSI)

    Animates voltage results of harmonic analysis in /POST1 by contouring the real part of the solution while varying the phase angle.

  • areacal.mac

    Carl Ostervig (Tech Inno)

    This macro calculates the number and area for all selected elements.

  • areatest.mac

    (ANSYS, Inc.)

    Tests areas for consistent normals (not needed at 5.6 since /PSYM,ADIR,1 allows plotting of normals). Also, you may need to rename this macro "ATEST"or "NORMALS"since "AREAS"is a status topic command.

  • arplot.mac

    (unknown source)

    Annotates each area with its size (/AN3D)

  • aslm_bw.mac

    Bram Weisman (SBM-IMODCO)

    Based on ALSM macro, created by John Crawford to select/reselect/unselect meshed areas. Written to take advantage of vectors to execute faster.

  • aswp.mac

    Bram Weisman (SBM-IMODCO)

    Divides a picked area with the working plane, retaining the area attributes for the newly-created areas.

  • attrib_2_Load.js

    (ANSYS, Inc.)

    "This script will apply a force load (magnitude 1000) on each entity that is flagged with an attribute beginning with DSA in the first assembly. There are two mechanisms by which this is done; one via the part manager the other via the DS tree."

  • attrib_2_Load_FEA.js

    (ANSYS, Inc.)

    "This script will apply load and boundary conditions based on attributes that exist on the model. They are filtered by an attribute prefix and divided by parts by a seperator."

  • attrib_2_MeshSizing.js

    (ANSYS, Inc.)

    "attributePrefix is intended to be the prefix of the attribute used in the CAD to represent mesh-sizing."

  • ave_tmp.mac

    Ted Harris (PADT)

    Computes the average temperature (from a thermal analysis) of the selected set of nodes. Example of the use of *VMASK.

  • avgtemp.mac

    David Power (Mallett Technology Inc.)

    "Get average element temperature for each element from nodal body loads.
    Unfortunately it's pretty slow for large models, and I haven't had any time to restructure it to make it run faster, although I'm sure I could make better use of the array operations."

  • avsucd.mac

    Ian Sigal (University of Toronto)

    "The macro writes an AVS UCD file that can be read by Amira. This allows quick display and post-processing. I use the macro to export a model formed of Solid92 tetrahedrals, but only the results in the four corners are written to the file. The macro also writes the element solutions, although these are not read by Amira, but are accepted in the AVS UCD standard."

  • axiget.mac

    Rod Scholl (PADT)

    Selects axi-symmetric elements based upon their keyopts. (PLANE42/82 Only)

  • b188to89.mac

    René Fiege (Jos. L. Meyer GmbH)

    "I attached a little macro to define new BEAM189s on the nodes and properties of the existing 188 elements."

  • battle.mac

    Dave Lindeman (3M)

    A macro used to play "Battleship"on ANSYS. (It's a very cool macro. I modified the macro very slightly since the answer was being revealed at 5.5 and 5.6, so /num,0 and /num,1 were added to prevent this from occurring. -- STI)
    From the author: By the way, please note that this is mugware - if you enjoy the game, or are mildly amused by the thought of a game written in APDL, please send one of your company mugs to the address below.
    Enjoy!

    Dave Lindeman
    CAE Specialist
    3M Company
    3M Center 235-1F-36
    St. Paul, MN 55144