US$0.00
0

How to Open Selected Part Separately from The Assembly in SolidWorks?

Overview

This macro allows you to open a part in an assembly quickly using a single command. To work more efficiently with SOLIDWORKS editing parts, assign this macro a key shortcut on your keyboard (e.g., the ‘O’ key). This will pull up whatever part you have selected in an assembly and open it in its own window to quickly review and modify without having to scroll down through the FeatureManager Design Tree. This is a particularly important feature to have when working with larger SOLIDWORKS assemblies or design projects, especially if you need to open selected part separately from the assembly in SolidWorks.

Open Selected Part Separately from The Assembly in SolidWorks and An illustration of a person working at a computer, with hands on a keyboard and mouse. The computer screen displays a 3D model of a mechanical part with a hole, viewed in a design software interface showing tools like "Pains," "Origine," "Extrusion," and "Add Step" on the left sidebar. An orange gear icon with a small robot face overlays the screen, symbolizing automation or AI assistance in the design process.

System Requirements

  • SOLIDWORKS Version: SOLIDWORKS 2014 or higher
  • Operating System: Windows 7 or higher

Pre-Requisites

For the successful functioning of the macro, be sure to check the following:

  • The active document is an assembly with at least one part in it.
  • A specific component is highlighted in the assembly prior to running the macro.

Results

When the macro is executed, it will perform the following actions:

  • The selected part will open in an additional SolidWorks window.
  • The main assembly remains open, allowing you to switch back to the assembly and the part quickly.

VBA Macro Code

' Disclaimer:
' The code provided should be used at your own risk.  
' Blue Byte Systems Inc. assumes no responsibility for any issues or damages that may arise from using or modifying this code.  
' For more information, visit [Blue Byte Systems Inc.](https://bluebyte.biz).

Option Explicit

Dim swApp As Object
Dim Part As Object

Sub main()
    Set swApp = Application.SldWorks
    Set Part = swApp.ActiveDoc

    ' Attempt to open the selected component part
    Part.OpenCompFile
End Sub

Macro

You can download the macro from here

Need To Modify The Macro?

The macro provides a straightforward answer to a frequently encountered workflow problem, making it easy for engineers to open the chosen part directly from the assembly to work on in detail. In fact, one of the most useful commands is to open selected part separately from the assembly in SolidWorks, which ensures smooth and efficient part handling. For those engineers and organizations wanting to improve their processes and create powerful, tailored tools, reach out to Blue Byte Systems Inc. Our team of professionals is ready to assist you anytime.

We provide custom macro development services to assist you in improving your productivity and gaining a greater competitive advantage. Please contact us today for assistance streamlining or improving your SOLIDWORKS workflow.

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
    ×