ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StyleHelper Class / CreateStyle Method
The current ArcGIS Pro project to which the new style will be added.
The full path on disk of the new style file to be created.
Example Version

CreateStyle Method
Creates a new style file (.stylx) on disk and adds the style to the current project. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static void CreateStyle( 
   Project project,
   string styleName
)

Parameters

project
The current ArcGIS Pro project to which the new style will be added.
styleName
The full path on disk of the new style file to be created.
Exceptions
ExceptionDescription
This method must be called within the lambda passed to QueuedTask.Run
Example
How to create a new style
//Full path for the new style file (.stylx) to be created
string styleToCreate = @"C:\Temp\NewStyle.stylx";
await QueuedTask.Run(() => StyleHelper.CreateStyle(Project.Current, styleToCreate));
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also