Macros

  • ds_MESCO_ContactName_NrTypeAdd.js

    Przemyslaw Siedlaczek (MESco)

    Workbench macro sets contact name by adding number and type ID.

  • ds_MESCO_SelectBodysByMaterial_EN.js

    Przemyslaw Siedlaczek (MESco)

    Workbench macro selects all bodies with the same material as the selected body.

  • dydxi.mac

    Bob Weathers (Trane)

    Calculates first derivative at the ith entry in a table.

  • e72to142.mac

    Tim Lansberry

    This is an ANSYS macro that converts solid72 elements to fluid142 elements. It defines a new element type for the fluid elements. Useful for creating models for FLOTRAN converted from other CAD packages which use a solid element type.

  • e72to45.mac

    Tim Lansberry

    This is an ANSYS macro that converts solid72 elements to solid45 elements. It defines a new element type for the solid45 elements.

  • e92to142.mac

    Tim Lansberry

    This is an ANSYS macro that converts solid92 elements to fluid142 elements. It defines a new element type for the fluid elements. Useful for creating models for FLOTRAN converted from other CAD packages which use a solid element type.

  • efatigue.mac

    Hursha Narayan (Robert Bosch Corporation)

    "I wrote this macro to make fatigue life prediction in Ansys more interactive and also to plot damage accumulation in a structure. The macro works under Unix environment or with Unix utilities in Windows. The user has to make appropriate changes (very minimal) to the macro for it to work. I'm also including a sample file that the macro uses to direct the user how to input material properties."

  • elem2pt.mac

    S. Evans (University of New South Wales)

    "I made a quick n' dirty macro a while ago for finding the element centroid nearest to a point...it doesn't QUITE solve the problem, since adjacent elements differing greatly in size can screw things up. But here it is anyway...it's a brute-force job (I used it for a couple of thousand elements)."

  • elgroup.mac

    John Crawford (Honeywell)

    "A macro which creates a file of esel commands for the currently selected elements. The macro will prompt the user for the name of the file which will be created. The default name is 'elgroup'."

  • ellipse.mac

    Janet Wolf (ANSYS, Inc.)

    Macro to make creating ellipses easier.

  • emf1.mac

    Mike Yaksh (NAC Int'l)

    "Example of computing the emf in a coil for a 2D planar model. The last thing on the screen will be a plot of the EMF. This macro cycles thought difference positions. Some more details on the CEs can be found in the EMAG training guides. One of the problems in the training uses the CEs for a sliding type application. Hope this helps."
    Please see updated EMF2 macro.

  • emf2.mac

    Bjoern Possner (VEM motors GmbH)

    Updated Mike Yaksh's EMF1 macro.
    "The older version of the EMF1 macro doesn´t account for the speed or frequency with which the magnet is being mooved under the coil. In addition, this macro has a correction with the 3600rpm value."

  • engineeringChecker.js

    (ANSYS, Inc.)

    "This file determines if the displacement for a total deformation result is greater than 1/10 of the diagonal of the geometry's bounding box. If it is greater, a comment is added to the "solution" node of the tree. The comment will tell how much greater than the diagonal of the bounding box the displacement is."
    One of the sample DesignSpace 6 macros provided, which can be found in the installation directory. Use "Tools > Run Macro" to run this macro.

  • ensight.mac

    Renato N. Elias (Federal University of Rio de Janeiro)

    This macro can be used to export tetrahedral meshes to EnSight or ParaView. This macro writes out the mesh information to a file called "jobname.geo".

  • erf.mac

    Sheldon Imaoka (CSI)

    This macro creates a table called ERF with error function values.

  • exportBranchAsShortcut.js

    (ANSYS, Inc.)

    "When run from DesignSpace, this script writes out a JScript shortcut file that can recreate the active branch contents on demand."
    One of the sample DesignSpace 6 macros provided, which can be found in the installation directory. Use "Tools > Run Macro" to run this macro.

  • ez_rfor.mac

    Mitch Voehl (CEC Corporation)

    This is an ANSYS macro that stores and sums reaction forces for specified/selected nodes into POST26 variables. It will store the x, y, and z translational reaction forces for all selected nodes and then sum them up. Be sure that you have previously set NUMVAR to a sufficiently large value to store all of the reaction forces.

  • f3d.mac

    Marcelo A Toledo (Multibrás S.A. Eletrodomésticos)

    "This is the macro i was writing about (named f3d.mac). For example ,if you want to aplly a pressure force of 450N at 45 degrees just type "f3d,450,1,1,0". The first argument is the magnitude and the last three are vector components in the same direction of the force . The macro will ask you to pick a area to aplly the force."

  • fclear.mac

    Chris Kennedy (Think PEAK, Inc.)

    Fast /CLEAR of ANSYS database.

  • fildel.mac

    John Crawford (Honeywell)

    A macro to remove a fillet radius and connect the neighboring two lines with a sharp corner.

  • findContactsAttachedToParts.js

    (ANSYS, Inc.)

    "This file determines which contacts are associated with each part in a selected model. A comment is added to the "model" node of each active branch in the tree which lists the parts and the contacts associated with it. This macro will only work if the model has more than one part in it."
    One of the sample DesignSpace 6 macros provided, which can be found in the installation directory. Use "Tools > Run Macro" to run this macro.

  • findFreeStandingPartsInTree.js

    (ANSYS, Inc.)

    "This file determines which parts in a selected model have no contacts associated with it. If the part has no contacts associated with it, that part will be selected in the tree. This macro will only work if the model has more than one part in it.
    This macro should be used at the model level or below. It is not intended for use at the project level or for multiple levels."
    One of the sample DesignSpace 6 macros provided, which can be found in the installation directory. Use "Tools > Run Macro" to run this macro.

  • findPartsWithNoContacts.js

    (ANSYS, Inc.)

    "This file determines which parts in a selected model have no contacts associated with it. If the part has no contacts associated with it, a check is also done to see if any supports are associated with that part. A comment is added to the "model" node of each selected branch in the tree. The comment will contain the names of the parts with no contacts and it will also show an error if those parts have no supports. This macro will only work if the model has more than one part in it."
    One of the sample DesignSpace 6 macros provided, which can be found in the installation directory. Use "Tools > Run Macro" to run this macro.

  • fins.mac

    Mike Rife (CSI)

    This macro is used to create a long cylinder with a radial, helical fin

  • fix.mac

    Kannan Sundararajan (General Electric-Power Systems)

    This macro uses the %_FIX% parameter to fix a particular nodal component after a load step.
    For details on %_FIX%, see the Commands online help for the "D" command.

  • fixdivs.mac

    James Kosloski (CAEAI)

    "I have attached a macro that changes the 'next' divisions for all the meshed lines to the same as the current mesh divisions. So you can run this macro then choose /psym,ldiv,0"

  • fldsurf-old1.mac

    Simon Shang (Aerojet Propulsion), slightly modified by Jeroen Valensa (Modine Mfg. Co.)

    Another way of defining SURF152 elements with FLUID116 instead of using AFSURF. Use component names for surface area and line as input arguments to this macro.

  • fldsurf.mac

    Jeroen Valensa (Modine Mfg. Co.)

    From the author:
    "The reason for not using the afsurf macro is that it takes so long to generate the elements - on very large thermal models I have seen that method take 12 hours, where my macro will do the same thing in about 15 minutes. The way to do the coupling is to create the surf152 elements first, using esurf. Select the solid elements over which the 152's will be overlaid, and select the nodes on the surfaces of the solid elements where you want the 152's to be created. Set the type, mat, and real. Change keyopt 5 to 0 (no extra node) - this will be changed back to 1 by the macro. Then just issue the esurf command, with nothing after it (no extra node assignment). Now you are almost ready to run the macro! Just select the NODES of the fluid116 elements and the surf152 ELEMENTS. An easy way to do this in your model would be:

    esel,s,type,,9
    nsle
    esel,s,type,,8

    Now run the macro, it will automatically map the closes fluid node to each surf152 element to be the extra node for that element. It may take a while if you have a large number of 116s and 152s, so just be patient. You won't get any feedback while it is running."

  • flohgen.mac

    (ANSYS, Inc.)

    Transfers joule heating loads from a harmonic analysis to Flotran analysis.

  • fxfrm08.mac

    Bill Bulat (CSI)

    Produces fourier transform of time domain response.

  • g_mur.mac

    Mike Yaksh (NAC Int'l)

    Loads the murx from the results for the active elements into material sets matching the element number +100 generates the macro chg_mat.mac

  • geta4l.mac

    Mark Fahey (Lingk & Sturzebecher)

    "Here is a macro that I made for myself to get all areas that have four lines. From these areas I decide what to map mesh."

  • getal.mac

    John Crawford (Honeywell)

    Loops through repeated ASLL, LSLA commands

  • getdir.mac

    Bob Weathers (Trane)

    Returns string with current working directory

  • geten.mac

    John Crawford (Honeywell)

    A macro to loop through the esln and nsle commands to select related nodes/elements

  • getface.mac

    Sheldon Imaoka (ANSYS, Inc.)

    This is a simple macro to group tetrahedral elements into element components based on the face number (1-4) that is exposed in selected surface(s). When using this macro, be sure that only a single face for a given element is exposed on selected surfaces.

    This is useful for the EDLOAD command using ANSYS LS-DYNA when applying pressures since element faces must be used. Can also be used for general elements with the SFE command.

    Feel free to customize/modify the macro for other element shapes (pyramid, wedge, hex) by increasing the number of faces checked.

  • getlk.mac

    John Crawford (Honeywell)

    Loops through repeated LSLK, KSLL commands

  • getmass.mac

    Sheldon Imaoka (CSI)

    This is a macro which *GET density and volume of selected elements and provides total volume and total mass of selected elements.
    May be useful for 2D axisymmetric elements, too.
    See Tips section for CSI's Tip of the Week on mass property calculation.

  • getpathname.mac

    James Kosloski (CAEAI)

    There exists a *GET to get pathname based on path number. However, this macro gets the current pathname in case you don't know what the path number is.

  • getreal.mac

    Bob Weathers (Trane)

    An example of how to parse through real constants which have been previously defined.