US$0.00
0

SolidWorks Macro to Instantly Isolate Selected Components in an Assembly

Description

Pre-select one or more components in an assembly and execute the macro. The selected components will become isolated in the assembly. The SolidWorks macro to instantly isolate selected components in an assembly can be placed on the Graphics Area menu (which pops up when you right-click a component) for convenient access.

SolidWorks Macro to Instantly Isolate Selected Components in an Assembly and An image divided into two side-by-side sections labeled "Before" and "After," showing a SOLIDWORKS software interface. The "Before" section displays a 3D model of a rectangular block with a red cylindrical component attached to its top surface, and a feature tree on the left listing "Control Panel" and "Valve Assembly" with various constraints and features like "Lifted Control." The "After" section shows the same block with the red cylindrical component removed, leaving a cutout section, and the feature tree updated to reflect the modified assembly. Both sections include toolbars and a 3D view with axes indicators.

System Requirements

  • SolidWorks Version: SolidWorks 2014 or newer
  • Operating System: Windows 7 or later

Prerequisites

  • At least one component must be pre-selected in an active SolidWorks assembly document.
  • The active document must be an assembly document (.SLDASM).

Results

  • The pre-selected components will be isolated in the assembly environment.
  • If no components are selected, or if the active document is not an assembly document, a message box will appear to direct the user to do so.

Steps to Set Up the Macro

  1. Registering the Macro File: Make sure you have SolidWorks open, and navigate to Tools > Macro > New… 
  2. Name and Register: Name the macro meaningfully (e.g., IsolateComponents.swp), then save the file. This will automatically open your VBA editor.
  3. Paste the VBA code: Please download the VBA code we have listed below and place it within your editor.
  4. Run Macro (Optional Next Setup): Close the VBA editor and save when prompted. Now you can run the macro with Tools > Macro > Run, or with a shortcut, or you can add it to a shortcut menu for convenience.

VBA Macro Code

Macro

You can download the macro fromĀ here.

We build custom macros and add-ins that meet your specific workflow needs. Contact us to discuss custom development needs and projects!

Author

Amen Jlili

Amen Jlili is the founder and technical director of Blue Byte Systems Inc., a software company in Vancouver, Canada, specializing in automating SOLIDWORKS and PDM. With over a decade of experience, he has authored several courses and open-source frameworks related to the SOLIDWORKS API. His leadership ensures that Blue Byte Systems prioritizes customer satisfaction and delivers high-quality software and CAD design solutions.
0
    0
    Your Cart
    Your cart is emptyReturn to Shop
    ×