The SolidWorks API (Application Programming Interface) is a set of tools, functions, and interfaces that allows interaction and automation of various aspects in SolidWorks software. By leveraging the SolidWorks API it is possible to automate repetitive design tasks, integrate SolidWorks with other software systems, create custom design applications, extract data for analysis and reporting, and enhance productivity for SolidWorks users. Using macro API calls are recorded to allow multiple executions with a simplified part creation process. This paper presents the use of SolidWorks API and macros for generating part within the SolidWorks environment. With macros is possible to generate a part by providing only input dimension values. After creating the part with the use of the macro recorder, the code was edited and the code for entering the input parameters was defined.