/API-Development

Working on the API Development part of the CAMWorks software by using SolidWorks macros in Visual Basic for Application

Additive manufacturing (AM) has revolutionized the manufacturing industry by enabling the creation of intricate and complex geometries that were previously difficult to achieve using traditional subtractive methods. SolidWorks, a widely-used CAD software, provides a robust API that allows developers to create custom solutions to enhance the software's capabilities. This demonstartes the development of an add-in for CAMWorks, aimed at leveraging SolidWorks API for automated adaptive slicing and path-filling algorithms to facilitate additive manufacturing processes.

The quickest and easiest way to start programming with the SOLIDWORKS API is to record a SOLIDWORKS macro, which contains the SOLIDWORKS API calls that correspond to the actions performed in the user interface. You can modify the macro in Microsoft Visual Basic for Applications (VBA) or Microsoft Visual Studio Tools for Applications (VSTA).

Microsoft VBA is a toolset based on Microsoft Visual Basic for Applications (VBA) and is embedded in the SOLIDWORKS software. Microsoft VBA lets you record, run, and edit Microsoft VBA macros in the SOLIDWORKS software. Recorded macros are saved as .swp files.

Adaptive slicing: Adaptive slicing is a crucial step in additive manufacturing, involving the segmentation of a 3D model into successive layers or slices, each representing a distinct layer of material deposition. These slices need to be accurately generated to ensure the fidelity of the final product. SolidWorks provides an API that allows developers to interact with the CAD model and create these slices programmatically. For example, consider a complex geometrical object designed in SolidWorks. The SolidWorks API can be utilized to create a bounding box around this object and extract its dimensions, coordinates, and other relevant properties. By dividing the height of the object by the desired layer thickness, we can determine the number of slices required.

Surface Selection and Path-Filling Algorithms: After generating the slices, the next step is to select the lower base surface of each slice. This is crucial for proper material deposition and adhesion between layers. SolidWorks API enables developers to select specific surfaces and manipulate them. Example, using the previously created bounding box, the add-in can programmatically identify the lower base surface of each slice. The SolidWorks API allows for automated surface selection and manipulation, ensuring accurate slicing and optimal material deposition. For path-filling algorithms, techniques like Hilbert curves and Bezier curves can be employed to create efficient toolpaths for material deposition. These curves offer optimal coverage of each slice, reducing material waste and improving print speed.

Integration with CAMWorks: CAMWorks is a CAM (Computer-Aided Manufacturing) software that specializes in generating toolpaths for machining processes. The proposed add-in aims to merge the adaptive slicing and path-filling algorithms developed using SolidWorks API with CAMWorks to facilitate efficient toolpath generation for additive manufacturing. The add-in can interface with CAMWorks through its API to seamlessly integrate the adaptive slicing results and path-filling algorithms. It can provide CAMWorks with the necessary information about each slice, including the selected base surface and path-filling instructions based on chosen algorithms. This integration streamlines the workflow and bridges the gap between CAD modeling and CAM toolpath generation.

Add-In Development: Developing the automated add-in involves creating a custom solution that combines the capabilities of SolidWorks API and CAMWorks API. This can be achieved using programming languages like C# or VB.NET. The add-in's user interface can consist of options to input layer thickness, select path-filling algorithms (e.g., Hilbert curves, Bezier curves), and configure CAMWorks settings. Once the user initiates the process, the add-in utilizes SolidWorks API to perform adaptive slicing and surface selection. It then communicates with CAMWorks API to generate toolpaths based on the selected algorithms.

The developed add-in offers several benefits and applications in the field of additive manufacturing: I. Automation reduces manual intervention, enabling faster and more consistent additive manufacturing processes. II. Efficient path-filling algorithms reduce material waste, contributing to cost savings. III. The add-in can handle complex geometries that might be challenging for traditional methods. IV. Users can customize slicing and path-filling parameters to meet specific requirements. V. The user interface simplifies the interaction between the operator and the technology.

The development of an automated add-in for CAMWorks using SolidWorks API opens new horizons for additive manufacturing. By harnessing the power of adaptive slicing and advanced path-filling algorithms, this add-in facilitates efficient and accurate toolpath generation, paving the way for the production of intricate and high-quality additive-manufactured parts. The integration of CAD modeling and CAM toolpath generation through this add-in exemplifies the synergy between software development and manufacturing innovation.