cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Java Function to Populate Version number to design sheets and artifacts

JimBarrettSmith
14-Alexandrite

Java Function to Populate Version number to design sheets and artifacts

A lot of customers have asked how they can set the version of a design in one location and have the version number populated to all the design sheets and artifacts.

I have attached the class file and java file so that you can test / modify the example.

If you do not have a java directory set up then do the following

1) Create a directory and save the files to the new directory

2) Create an environment variable client_classpath and set the value to your new directory

28-04-2015 19-18-41.png

3) Restart Creo Schematics

How to use the java function for design sheets

1) From the Design explorer open the sheet properties of a design sheet and add the parameter Version with a value of A.1 (you only need to do this on one design sheet)

28-04-2015 19-09-10.png

2) For each design sheet, add a sheet label with the format {DeriveFromSheet.findVersionOnOtherSheet()}  - Notice the label is reporting A.1

28-04-2015 19-13-18.png

3) Edit the sheet properties of the design sheet that has the parameter Version applied to it and change the value from A.1 to A.2

4) Choose update labels and notice the design sheet label now displays the new version A.2

How to use the function with artifacts

1) From the Global Parameters, Select Parameter Version and Select Modify

28-04-2015 19-22-03.png

2) From the Parameter Definition dialog select Define Function

3) From the Define Function window set the Function name to {DeriveFromSheet.DesignSheetVersion}

28-04-2015 19-25-26.png

4) Close all the windows by choosing OK

5) Edit the properties of a placed item on the sheet for example a connector and add the parameter Version

6) Check on Calculated value Notice A.2 is displayed .

28-04-2015 19-29-06.png

7) Change the version value to A.3 on the design sheet and choose update labels.  Notice all the sheet labels and the version parameter on your selected artifact now reflect the new version number.

Enjoy!


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
5 REPLIES 5

Based on some feedback from the community I have updated the class and Java files with new files which are compatible with Creo Schematics 2.0 and 3.0

The function has also been extended to support any user defined parameter. 

For example I have created a user defined parameter "fred".

I added parameter fred to my sheet properties

1.png

On my design sheet I added a sheet label using format {DeriveFromSheet.findParameterOnOtherSheet(fred)}

2.png

3.png

To have the parameter work with artifacts I modified parameter fred to have a derived function using the Function name of {DeriveFromSheet.findParameterOnOtherSheet} and added fred to the Parameter List.

4.png

I then added parameter fred to the artifact properties and check on Calculated Value

5.png

Enjoy the update and as always thank you for the feedback

Hi Jim,

Can we use Windchill PDMLink attributes in Creo Schematics drawing sheet formats, like we can with MCAD applications ?

Does it work with both implicit and explicit attribute mapping ?

- the former by using Attribute names that match Windchill Global Attribute names exactly (and they are in CAPITALS)

- the latter by using mapping(s) in the Type & Attribute manager (which we haven't needed for Creo Parametric and SolidWorks)

Best regards,

Nick

Nick

Not out of the box because windchill does not understand the design sheets

thanks

Jim

Jim,

So how about with some configuration and/or customisation ?  Can we at least get something onto sheet no.1, if not all sheets ?

We learned how to customise the Windchill "download delegate" to populate Creo Parametric and SolidWorks CAD Documents and thus their primary attached files with some Windchill Global Attributes, so we can show them in the Title blocks of drawings, using the relevant native syntax for 3D model and 2D drawing file Attributes respectively, ie. &param_name and &param_name:d in Creo Parametric or $PRPSHEET:PARAM_NAME and $PRP:PARAM_NAME in SolidWorks (which looks the wrong way round, but isn't !), and I have seen on CS153602 and in the v2.0 Basic_Tutorial that Creo Schematics uses the syntax \<param_name>.

So what's the missing piece of the jigsaw needed to get a Windchill WGM CAD Document attribute into a Creo Schematics design ?

Best regards,

Nick

Nick

Using the apis of creo schematics and windchill you can extract from one and import into the other but i could not tell you what Apis to use.  Someone like virtual-interconnect.co.uk could provide such a customisation, thanks, Jim

Top Tags