Interactive Publishing with swpublish
swpublish is a script that is run to create an environment in which SolidWorks CAD data can be interactively published.
The advantage of using swpublish over swbatch is that swpublish opens SolidWorks, where you can see the part as well as modify its attributes prior to publishing. This enables you to obtain precise results for publishing CAD data.
This chapter describes how to use swpublish in an active session of SolidWorks.
swpublish Overview
SolidWorks CAD data is converted to the Creo View format using a method called publishing. During a fully interactive user session with SolidWorks, the user selects an option that allows the conversion of the current CAD data.
* 
Only one instance of SolidWorks can be run on a computer. If you are already running SolidWorks, swpublish, swbatch, or swworker, any attempt to run another swpublish process will fail, displaying the following error:
sw2pv Fatal: SolidWorks is already running please exit SolidWorks first
Using swpublish
The swpublish script is created when you used the sw2pv_config program described in the last chapter. This file is located in the selected <setup_directory>.
To run swpublish from the command line, type:
<setup_directory>\swpublish
This opens a session of SolidWorks. The Publish to Creo View option is available in the main SolidWorks File menu.
On Windows, you can also double-click the swpublish.bat file located in the <setup_directory>.
* 
For quick access to interactive publishing, create a shortcut by right-clicking the swpublish.bat file and selecting Send to > Desktop (Create Shortcut).
To run and test swpublish, follow these steps:
1. Open a command prompt and run swpublish. A session of SolidWorks starts.
2. Open the CAD data that you want to interactively publish.
3. With the CAD data in view, select Publish from the main menu. The following sub-menus are displayed:
a. Recipe File
Selecting this option opens a dialog box, where you specify the name of the recipe file you want the adapter to use while converting the CAD data. If you do not use this option, the adapter uses the configuration recipe file. See section Introduction to Recipe Editing for Converting CAD Data for more information.
b. Output Path
Enter the path to the directory where you want to place the converted files once they are published. If you entered a default path in the recipe file, you do not need to use this option.
c. Publish to Creo View
Select this option to initiate publishing.
4. Once you have published the current CAD data, you can open the output in Creo View.
You have now published data interactively using swpublish.
Was this helpful?