Search

image image image
PC Temperature Monitor Bay The 14-bit highly accurate temperature/humidity LCD for gaming and overclocking enthusiasts is coming soon. Keep track of your case temperature to within 8 decimal places of accuracy, as well as CPU uptime and custom messages.
Learn SolidWorks API Ever wanted to learn the SolidWorks API programming language from the experts? Why not take a look at our API Books in the Features section!
AngelSix Game Studio Upcoming Xbox 360 Live games due shortly from ourselves. "The Adventures of Silver: The Dark Fiend" coming soon to Xbox 360! Find images in the Downloads section.
* * *
Tuesday September 07 , 2010
Font Size
   

SolidWorks Macros

Folder Path: \

Files:

  • zip.png

    Area Solver

    Downloads:
    31

    This macro will take a part with 2 bodies and alter the required dimension to an accuracy of 8dp so that the areas of the 2 bodies is identical. Find attached sample SolidWorks part to test the macro on.

  • zip.png

    Auto-create Drawing from Model

    Downloads:
    174

    This macro with one click creates a drawing with 3 common views and an isometric view, aligns them and inserts all dimensions onto the 3 standard views, and saves it to the same location as the model.

  • zip.png

    Bulk Change Part Material

    Downloads:
    75

    A macro to change bulk Part Material. The macro will open each part, change the material, rebuild, save and close the file.

    Change the material and if required change the database too.

    ' Prerequisites: Set the directories having part files you wish to change the material

    Macro will find all the part files in the specified folder/location and change the material to specified one.

  • zip.png

    Change Sheet Format

    Downloads:
    93

    A macro on changing/updating sheet format of multiple drawings.

  • zip.png

    Create Flat Pattern Drawing

    Downloads:
    147

    For those of you who have to produce flat pattern DXFs for production (laser/plasma) cutting or the likes, you may be using tools such as Lantek or manually creating your own sheets with flat-pattern views at a 1:1 scale.

    This macro will automatically create a new sheet at 1:1 scale and place a flat pattern view on it with the click of a button. From ther it will then prompt you whether you would like it to go ahead and save the flat pattern to DXF for you, and finally whether to delete the flat pattern sheet it created once done.

    The macro now automatically removes hole centre notes and bend lines etc...

    PS. Once you have the flat pattern sheets created in your drawings, you could also use BatchProcess to automatically create all the profile sheets for you in any format (i.e. DXF, DWG) in one go.

  • zip.png

    Delete Design Table

    Downloads:
    32

    This macro is nice and simple; it deletes the currently active models design table

  • zip.png

    Equation Editor

    Downloads:
    57

    This is a simple tool that mimics the "Edit All" equation options of a model just like SolidWorks... only this one works.

  • zip.png

    Export BOM

    Downloads:
    128

    You have two methods for extracting BOMs to Excel. One is the in built function of SolidWorks, and the second is the manual way to creating exactly what you want in an Excel sheet.

    The attached Macro does performs both.

    Make sure you check that your References... are setup to your version of SolidWorks & Excel (Current example is SW2008 & Excel 2007):

    You may use this macro however you wish, I only ask you leave the commented credits within the macro.

    If you wish to save each BOM under the name of a value from the custom properties, such as $PRPSHEET:{Description}, you would modify the code to get the bomPath as follows:

    Code:
    Dim swApp               As SldWorks.SldWorks
    Dim swModel             As SldWorks.ModelDoc2
    Dim valOut              As String
    Dim resolvedValOut      As String
    Dim config As SldWorks.Configuration
    Dim cpm As SldWorks.CustomPropertyManager

    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc

    Set cpm = swModel.Extension.CustomPropertyManager("")
    If Not cpm Is Nothing Then
    cpm.Get2 "description", valOut, resolvedValOut
    End If


    Now with resolvedValOut you may use that as the filename in any way you wish.

  • zip.png

    Export Flat Pattern View

    Downloads:
    89

    Preconditions: A Sheet metal part is open.

    Postconditions: Macro will export flat pattern view for all configuration(s) and save as dxf in the same location.

  • zip.png

    Feature Tree to Clipboard

    Downloads:
    58

    This macro is a simple one to copy the active documents feature tree directly to the clipboard.

  • zip.png

    Find Center

    Downloads:
    29

    This macro will find the center of any number of selected sketch points and either add a point at that position, or inform the user via message box.

  • zip.png

    Flattern Layers

    Downloads:
    29

    This macro will delete all the current layers (contents of layers are not deleted) and 5 layers with Color Red, Black, Green, Yellow and Brown with Line style as Solid and Thickness as 0.0138 will be added.

  • zip.png

    FuncPlot

    Downloads:
    49

    Mahir Abrahim has created 2 very useful macros that can create 3d curves, spirals, surfaces and more based on given equations. Very useful!

    *FuncPlot
    Description: Automates the plotting of 3D curve functions. Equations can be input using Cartesion, cylindrical, or spherical coordinates. Can create either curves or 3D sketches. Also has the option of exporting 3D data points. Uses Excel for calculations.
    Precondition: Part or Assembly open
    Postcondition: 3D curve or sketch created

    Quote:
    [Note: t can only be evaluated from 0 to 1. However, you can easily get around this. If you want your function's domain to be [A,B], then replace any instance of "t" with "(B-A)*T - A". ]

  • zip.png

    Get Component Colors

    Downloads:
    41

    This macro is very simple. It gets/sets the color values of the selected component within an assembly.

  • zip.png

    Get Part Colors

    Downloads:
    43

    This macro is much like the Get Component Colors macro, except it traverses a single part, and gets all body and face color information, then selects each entity and displays its color properties in a message box.

  • zip.png

    Get Point Coordinates

    Downloads:
    54

    This macro gets the coordinates of a selected sketch point in a model and sets a custom property to that value.

    There is no error checking in this macro so feel free to add it yourself.

  • zip.png

    Hide or Show Any Tables

    Downloads:
    29

    This macro shows you how to change the visibilty of any table in a drawing sheet. Have fun!

  • zip.png

    Import Table

    Downloads:
    108

    This macro is in high demand. Using it you actually IMPORT any Excel sheets (such as exported BOMs or any sheets you wish) directly into a SolidWorks drawing.

    To use it simply open the SolidWorks drawing you wish the table to be imported into, and open the Excel file you wish to import.

    From there, highlight in Excel the data you wish to import, then go back to SolidWorks and run the macro.

    Don't forget to alter the references to your version of Excel and SolidWorks, and keep all original credits to AngelSix. Enjoy!

    This macro has now been updated to import cell formatting, font formatting, alignment and colum/row widths and heights to give a more full import!

  • zip.png

    Increment Angle

    Downloads:
    32

    This macro increments a specific Angle mate each time it is run, by a set amout of Rads or Degree.

  • zip.png

    Mass Alter Dimensions

    Downloads:
    37

    This macro will mass alter all of the selected dimensions by a set amount, or by a percentage of their original value, or both, and another version has added multiply, division, addition and subtraction.

  • zip.png

    Save As Part Number

    Downloads:
    52

    Description: Macro to save existing part files in the specified folder/location, to a new location with specified custom property value as part name. Part Number is used as a Custom property in this macro.

    Pre-Conditions: Set the directories for opening the part from and saving to new location. Part files exist in the specified location.

    Post-Conditions: New part files with specified custom property value as part name. Macro will overwrite any existing part with same name.

  • zip.png

    Save As PDF

    Downloads:
    74

    This macro will save all drawing sheets as PDF files, one PDF per sheet.

    As usual no error checking has been done I will leave that up to you lot.

  • zip.png

    Set Bulk Material

    Downloads:
    47

    As many of you probably know. You cannot select parts from in an assembly and set their material without having to open them first.

    With this macro, you can simply select any parts in the assembly, select the appropriate material, and then click a button to have the material set in all selected parts.

    I have left room for expansion and improvement in this macro for ease of understanding. Any modifications, please credit AngelSix for the original macro.

  • zip.png

    Set Component Names

    Downloads:
    50

    This macro will loop all components within an assembly and set their Component Name to that of any custom property value within each part. So for example you can set the Component Names to equal whatever the parts "Description" custom property is set to.

    This is useful when exporting as eDrawings as eDrawings will always show the Component Names.

  • zip.png

    Set Document Arrows

    Downloads:
    45

    This macro is short and sweet. With one click sets the current documents Arrow formats up to whatever you specify within this macro. This is ideal for updating old templates to the new standards.

  • zip.png

    Set Document Font

    Downloads:
    45

    This macro is similar to Document Arrows. With one click sets the current documents Font styles to whatever you specify within this macro. This is ideal for updating old templates to the new standards.

  • zip.png

    Set Thickness Property

    Downloads:
    41

    If run within a sheet metal part, this macro will automatically set the "Thickness" field in the models custom properties to the thickness of the sheet metal.

    If run in a normal model, select a dimension you wish to be set as the thickness prior to running this macro, and that dimension will be set as thickness.

  • zip.png

    SurfPlot

    Downloads:
    38

    Mahir Abrahim has created 2 very useful macros that can create 3d curves, spirals, surfaces and more based on given equations. Very useful!

    *SurfPlot
    Description: Automates the creation of surfaces from 3D surface functions. Equations can be input using Cartesion, cylindrical, or spherical coordinates. Can create either surfaces and/or curve sets. Uses Excel for calculations.
    Precondition: Part open
    Postcondition: Surface or curve set created

    Quote:
    [Note: t can only be evaluated from 0 to 1. However, you can easily get around this. If you want your function's domain to be [A,B], then replace any instance of "t" with "(B-A)*T - A". ]

  • zip.png

    Toggle Units

    Downloads:
    45

    This macro will toggle the document units between metric and imperial on each click.

  • zip.png

    Traverse Through Features

    Downloads:
    58

    This macro is a good example of part traversal; it loops through all features of a part and performs operations on them based on conditions.

    This specific example loops through a part and suppresses any fillets that are less that X mm.

    This can be easily expanded to work on assemblies too.

Page 1 of 2
Results 1 - 30 of 31