Skip to main content
6-Contributor
February 10, 2023
Question

Creating Publishing rules in Windchill

  • February 10, 2023
  • 2 replies
  • 2668 views

Hello everybody,

 

I am trying to make my first steps in creating publishing rules but I am not really sure what to do. Actually I am using this .xml code.

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://www.ptc.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ptc.com PublishRulesSchema.xsd" >

	<authoring-application name="PROE">

		<additional-files name="standard_files">
			<file type="dxf" display-label="DXF" default="true" output-prefix="dxf"/>
		</additional-files>

		<publish on="checkin" additional-files="standard_files">
			<param-set-ref name="Additional Files Post Publish for Released Document"/>
		</publish>

		<publish on="create-representation" additional-files="standard_files">
			<param-set-ref name="Additional Files Post Publish for Released Document"/>
		</publish>

		<param-set name="Additional Files Post Publish for Released Document">
			<post-publish name="delegate">com.ptc.wvs.server.publish.AdditionalFilesPostPublishDelegate</post-publish>
			<post-publish name="name">TEST_{AUTHORING_APP}_{EPM_NUMBER}_{ADDITIONAL_FILE_SECONDARY_EXTENSION}</post-publish>
			<post-publish name="additional-file-secondary">.*\.(igs|stp|dxf)</post-publish>
			<post-publish name="published-content-link">Released</post-publish>
		</param-set>
		
	</authoring-application>
	
</rules>

 

 

 

First of all can somebody explain me the difference between the parameters DefaultPostPublishDelegate, 

EPMPostPublishDelegate and DDPostPublishDelegate? 

 

My target is to generate dxf data in a specific number range of parts during the check-in. Can somebody help me with my project? I am actually using Windchill 12.1 with creo_view_adapters.

 

Thanks in advance!
Chris 

 

 

 

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
February 13, 2023

Hi @CC_10081426 

The general explanation for the delegate is in help

WVSPublishRules/WVSPublishRulesPostPublishDefault

 

Here is example how to define DXF and condition with filename

 

<?xml version="1.0"?>
<rules evaluate-rules-on-republish="true"
	xsi:schemaLocation="http://www.ptc.com PublishRulesSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ptc.com">
	<authoring-application name="PROE"> 
		<additional-files name="standard_files">
			<!-- only default='true' files will be generated at this time -->
			<file output-prefix="step" default="false" type="step" display-label="STEP"/>
			<file output-prefix="iges" default="false" type="iges" display-label="IGES"/>
			<file output-prefix="dxf" default="false" type="dxf" display-label="DXF"/>
			<file output-prefix="cgm" default="false" type="cgm" display-label="CGM"/>
			<file output-prefix="pdf" default="false" type="pdf" display-label="pdf"/> 
		</additional-files>		
		
		<additional-files name="released_drawing">
			<!-- only default='true' files will be generated at this time -->
			<file output-prefix="step" default="false" type="step" display-label="STEP"/>
			<file output-prefix="iges" default="false" type="iges" display-label="IGES"/>
			<file output-prefix="dxf" default="true" type="dxf" display-label="DXF"/>
			<file output-prefix="cgm" default="false" type="cgm" display-label="CGM"/>
			<file output-prefix="pdf" default="true" type="pdf" display-label="pdf"/> 
		</additional-files>
		<condition name="is_released_drawing">
				<and>
					<attribute name="epmdoc_CADName" regex=".*\.drw" /> <!-- HERE YOU CAN DEFINE YOUR CONDITION WITH SPECIFIC FILENAME --> 
					<attribute name="epmdoc_lifeCycleState" value="Released"/>
					
				</and>
		</condition>

		<if condition="is_released_drawing">
			<publish on="checkin" display-label="Released Drawing" additional-files="released_drawing"/>
		 <publish on="create-representation" display-label="Released Drawing" additional-files="released_drawing" />
		 <publish on="schedule" display-label="Released Drawing" additional-files="released_drawing"/>
		 <publish on="unknown-source" display-label="Released Drawing" additional-files="released_drawing"/>
		</if>
		
		<publish additional-files="standard_files" on="checkin"/>
		<publish additional-files="standard_files" on="create-representation"/>
		<publish additional-files="standard_files" on="schedule" />
		<publish additional-files="standard_files" on="unknown-source" />
	</authoring-application> 
</rules>

 

PetrH

6-Contributor
February 13, 2023

Hello PetrH,

 

thanks for the fast reply! This code helps a lot. But in general the problem is that we have a .drw file out of creo wich includes 2 sheets. I only need a .dxf fie out of the second sheet. Is there a possibility to limit a .dxf export?

 

Thanks in advance.

 

Best regards. 

HelesicPetr
22-Sapphire II
22-Sapphire II
February 13, 2023

Hello @CC_10081426 

 

Unfortunately there isn't OOTB possibility to limit the DXF sheets in additional files.

 

I needed many years ago, but I didn't find any way how to achieve it. 

 

I decided to use an another way. Users had to create a DXF attachment file from second sheet.

Users used a macro to do the action without losing time in a Creo.. 

 

I set a control mechanism to check if the attachment is out-of-date and force users to regenerate the DXF attachment.

 

PetrH 

20-Turquoise
February 13, 2023
HelesicPetr
22-Sapphire II
22-Sapphire II
February 13, 2023

Hi @RandyJones 

Good one, but archived it's a pity. 

If @CC_10081426 would like to rise the idea he needs to create a new one and try to get enough votes from others.

PetrH

20-Turquoise
February 13, 2023

@HelesicPetr wrote:

Hi @RandyJones 

Good one, but archived it's a pity. 


I see 😞