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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

how to select a default folder based on CAD authoring application in PDMLink v9.1 ?

NickD
10-Marble

how to select a default folder based on CAD authoring application in PDMLink v9.1 ?

We wish to sort Pro/E files and SolidWorks files into two separate folders in PDMLink v9.1 M062, within the same Product context. How can we set this to happen automatically by default ?

For example we could have the folders /Default/MCAD/ProE and /Default/MCAD/SolidWorks (and each could have more sub-folders for any further 'manual' sorting).

I guess we could create two sub-types of the 'Workgroup Manager CAD Document' type in the Type & Attribute Manager, and then we could quite easily write two simple OIRs that set the specific folders for each sub-type, but in this case how can we associate each of those sub-types with a specific authoring application (in the Type & Attribute Manager) ?

Alternatively, I suppose we make use of the conditional logic facility within the OIRs to select the appropriate folder based on the authoring application, but how would we use the authoring application name within the OIR ?
ie. we want to do something along the lines of...
if AuthoringApplication=PROE then default folder.id= /Default/MCAD/ProE
if AuthoringApplication=SOLIDWORKS then default folder.id= /Default/MCAD/SolidWorks

Any help gratefully received !

ACCEPTED SOLUTION

Accepted Solutions
ngiacom
14-Alexandrite
(To:NickD)

Hi, for me the solution is:

<!-- set the folder -->

<AttrValue id="folder.id" algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">

<Value algorithm="wt.rule.algorithm.CaseBranch">

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>PROE</Arg>

</Value>

<Arg>/Default/MCAD/Proe</Arg>

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>COCRDRAFT</Arg>

</Value>

<Arg>/Default/MCAD/Drafting</Arg>

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>SOLIDWORKS</Arg>

</Value>

<Arg>/Default/MCAD/SolidWorks</Arg>

<Arg>/Default/MCAD/Generic</Arg>

</Value>

</AttrValue>

View solution in original post

16 REPLIES 16
MikeLockwood
22-Sapphire I
(To:NickD)

People tend to invest HUGE effort into folders - since people are used to file systems. But, in PLM, it's a losing and unnecessary battle.

As soon as you have more than a few hundred objects, it's unrealistic to browse thru Folders. Also, the Folders view lists all Revisions - a major nuisance.

Our humble recommendation - put everything in one bucket and rely on search and collection tools. Use folders only where you need to restrict permissions (supplementing ACLs).

Hi Mike,

Thank you for the rapid reply.

We don't use many folders at all, but we do want a few in a standard folder structure in each of our 'Products' (and we will have one Product for each of our many projects, thereby reducing the number of folders !). And yes, we do want them so we have the option to restrict access permissions - in this case to allow our project managers a simple way to choose which CAD tool(s) are permitted to be used on each project, as sometimes we want to restrict them to use Pro/E or SolidWorks only.

I think we are only seeing the lastest version (revison.iteration) of CAD files and WTParts in the folders view, and this is certainly OOTB behaviour with the "All" table view as it has the Filter set for Revison = latest, so that doesn't appear to be a problem.

Do you think we are on the right track with either of the approaches I suggested, or is there another way - for example within the Preference manager or wgmclient.ini file settings ?

MikeLockwood
22-Sapphire I
(To:NickD)

I don't know specifcally how to do it but using logic on the OIR for EPMDocument is proabably the way to go. Contact Kathy Richardson at Paragon Space Development - I think she set up a Numbering prefix based on whether Pro/E or SolidWorks is used - should be able to extend fairly easily.

Hi Mike,

I did contact Kathy Richardson, and she told me that they map an attribute in the OIR to create three types of EPMDocumets 'Production', 'Experimential' & 'Standard', and the desired parameter needs to be entered in the CAD model prior to upload - but they don't differentiate between Pro/Engineer and SolidWorks EPMDocuments.

So what I have put in the OIR to test is as follows :

<!-- set the folder for each MCAD application type - this will only work for two apps as written -->

<AttrValue id="folder.id" algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">

<Value algorithm="wt.rule.algorithm.BooleanBranch">

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>PROE</Arg>

</Value>

<Arg>/Default/MCAD/ProE</Arg>

<Arg>/Default/MCAD/SolidWorks</Arg>

</Value>

</AttrValue>

I looked in the Type & Attribute manager in v10.0 to find that EPMDocs have an attribute called "authoringApplication" and it has a default value of PROE (from a list of options that goes beyond the width of the dialogue box), but when I tried this OIR with a new Pro/E file it was placed in the SolidWorks folder. I assume this means that I have either not got the right attribute name or a valid value that indicates a Pro/E file, as the logic has resulted in the second option being selected.

Do you know how to check the name of the attribute and the valid values in v9.1, as it is not shown in the Type & Attribute manager ?

tia'

Nick

GregoryPERASSO
15-Moonstone
(To:NickD)

hello

I think the name is OK ... but may be the returned value is not PROE

Authoring application is a hard modeled master attribute. May be when init rules are invoked, you do not have yet the value persisted on the EPMDocumentMaster

regards

HI Gregory,

I have tired it with another attribute that already exists in our Pro/E start part (template file), and this is one that is already implicitly mapped (ie. the attribute name is in CAPITALS and matches between Pro/E and Windchill) - but this doesn't trigger the 'true' BooleanBranch either.

I have tried using PROE, proe and Pro/ENGINEER as the test values and none of them makes any difference to the result - it always goes down the 'false' BooleanBranch and puts the file in the SolidWorks folder. The last of these (Pro/ENGINEER) is the one shown on the object info' page, so I wonder if the presence of the "/" character is upsetting the OIR ?

Does anyone have any specific examples of using a Pro/E file parameter name &value to get an attribute & value to use in an OIR ?

Nick

ngiacom
14-Alexandrite
(To:NickD)

Hi, for me the solution is:

<!-- set the folder -->

<AttrValue id="folder.id" algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">

<Value algorithm="wt.rule.algorithm.CaseBranch">

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>PROE</Arg>

</Value>

<Arg>/Default/MCAD/Proe</Arg>

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>COCRDRAFT</Arg>

</Value>

<Arg>/Default/MCAD/Drafting</Arg>

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>SOLIDWORKS</Arg>

</Value>

<Arg>/Default/MCAD/SolidWorks</Arg>

<Arg>/Default/MCAD/Generic</Arg>

</Value>

</AttrValue>

NickD
10-Marble
(To:ngiacom)

Hello,

I tried a slightly cut down version of what you suggested, as follows :

<AttrValue id="folder.id" algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm">

<Value algorithm="wt.rule.algorithm.CaseBranch">

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>PROE</Arg>

</Value>

<Arg>/Default/MCAD/ProE</Arg>

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>SOLIDWORKS</Arg>

</Value>

<Arg>/Default/MCAD/SolidWorks</Arg>

<Arg>/Default/MCAD</Arg>

</Value>

</AttrValue>

As we dont use CoCreate, and I am happy to have anything that is not Pro/E or SolidWorks end up in the /Default/MCAD folder. I also made the name for the ProE folder match the case of the actual folder, and reloaded the OIR, but it still ends up putting the Pro/E files in the /Default/MCAD folder.

The only thing I can think of now is that we need to have the right constraints set in the same OIR file.

May I ask if the code you suggested is working in your system, and if so, what version are you on ?

Best regards,

Nick

ngiacom
14-Alexandrite
(To:NickD)

This solution works on Windchill 10.1 M010 but in my opinion it should work also in previuous versions.

In proe is necessary to upload the epmdocument before the checkin test or to use dm_upload_objects=automatic in config.pro.

NickD
10-Marble
(To:ngiacom)

We do have the config.pro setting dm_upload_objects=automatic, but it still doesn't work in v9.1

What is of some concern is that it says in the v9.1 and v10.0 Help pages for OIRs, in the section about Conditional Rule Algorithms :

...any attribute used within default value algorithms for conditional logic evaluation purposes must be set before the object initialization code executes.

Note: The use of conditional logic requires that you understand the sequence of how values are set for attributes through the user interface. For example, current user interface implementation for selecting folders does not support the use of conditional logic for the folder.id attribute.

Are the same notes present in the v10.1Help pages for OIRs ?

NickD
10-Marble
(To:NickD)

UPDATE : We have just upgraded to v10.2 M020 and this does work now.  We have also tested it in v10.2 M030.

ngiacom
14-Alexandrite
(To:NickD)

Yes....same notes. Proe WF5?

Have you tested also browser behaviour?

I am attaching a video to make sure that we are understanding which is the desired behaviour. Video Link : 3325

NickD
10-Marble
(To:ngiacom)

Yes, that looks like it is exactly what we are trying to do. Has anyone else done this in v9.1 or v10.0 ?

I spent a couple of hours yesterday in a Webex session with the tech support guy from our VAR, and having very carefully checked everything in our OIRs, done full server re-starts, cleared Tomcat and WGM caches, etc, we concluded that we were unable to get a TRUE response from any of the blocks of code such as :

<Value algorithm="wt.rule.algorithm.EqualsTest">

<Attr id="authoringApplication"/>

<Arg>PROE</Arg>

</Value>

We even tried it with StringEqualsTest just in case the examples given in the manuals and on line Help are 'documentation errors', but without success. We are pretty convinced that we have the right attribute names and values, and we have tried it from both SolidWorks (v2010) and Wildfire3.

The Method Server log does not offer any clues, as there are no errors reported. Is there an option to get a more verbose response in that log file ?

We thought of a "1-shot" test to try in the OIR by checking for "name" = <testfilenameX>, to see if we can get anything to return a TRUE response, but after that we can only escalate the call with PTC and write an enhancement request that will no doubt be ignored for v9.1

It would be nice if we could go straight up to v10.0 or v10.1 but the restrictions imposed by the application compatability matrix mean that we have to start with v9.1

Hi Nicola

I need your help, similarly i need to separate CAD files in CAD Document folder and all Documents files in Document folder.

also i need all Promotion request should go to PR folder.

please suggest me code for above mention two cases.

Thank you.

Best Regards

Sharan.

BenLoosli
23-Emerald II
(To:smadhavaram)

Set the default folders in the OIR for each object type.

NickD
10-Marble
(To:BenLoosli)

I agree.  If you just want to sort Types into folders, then its easy to do this in the OIRs.

If you want to sort by MCAD Authoring Application (which by default all use the same Type), then you either have to create sub-types and setup an OIR for each of them, or if you are running v10.2 you can use the conditional logic shown above.  I can confirm this works in v10.2 and we have all our Pro/E and Creo-Parametric files going into one folder, and all the SolidWorks files going into another folder automatically.

Announcements


Top Tags