Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi
We can identify aliased URL for model using API ProServerModelNameToAliasedURL(). This URL can be used to check-out model from windchill.
My query is that can we find all objects presents into windchill and from name of the those CAD objects, I would like to get aliased URL.
Is it possible through toolkit to get list of objects present in Windchill?
Thanks and Regards
Ketan
Solved! Go to Solution.
Hi, did you try ProFilesList?
You can get list of objects and subdirs from ProFilesList.
E.g. from path „wtpub://sip7/Products/product_name/parts/“ you obtain list (array) of:
wtpub://sip7/Products/product_name/parts/model_a.prt
wtpub://sip7/Products/product_name/parts/model_b.prt
…
This file pathes you can use to load models into a Workspace by ProMdlFiletypeLoad (or parse them and use ProMdlnameRetrieve).
Of course, you have to traverse subfolders recursively and scan Context by Context (mean „product_name“ - ProServerContextsCollect), and we talk about EPMDocumnets only…
It depends, what you need. Probably fast way would be ask through the WindChill API (I don't know it).
PZ
Hi, did you try ProFilesList?
You can get list of objects and subdirs from ProFilesList.
E.g. from path „wtpub://sip7/Products/product_name/parts/“ you obtain list (array) of:
wtpub://sip7/Products/product_name/parts/model_a.prt
wtpub://sip7/Products/product_name/parts/model_b.prt
…
This file pathes you can use to load models into a Workspace by ProMdlFiletypeLoad (or parse them and use ProMdlnameRetrieve).
Of course, you have to traverse subfolders recursively and scan Context by Context (mean „product_name“ - ProServerContextsCollect), and we talk about EPMDocumnets only…
It depends, what you need. Probably fast way would be ask through the WindChill API (I don't know it).
PZ
Good option. I tried using API of ProFilesList(). How to identify whether context is product or library once we get contexts name using ProServerContextsCollect()? Product or Library is required for to prepare full directory path for ProFilesList() API.
Hmm, the easiest way to differ them, is just from path (wch contexts are usually divided as follows):
wtpub://sip7/Products/product_name/parts/model_a.prt
wtpub://sip7/Libraries/norms/iso_a.prt
wtpub://sip7/Workspaces/
wtpub://sip7/Site/
----------------
Hmm, sorry, I didn't realize that, you don't know anything at the moment 🙂
So, try it? - check if context is accessible from Products\ or Librarier\ (at ProFilesList)?
PZ
I have to correct myself, you can travers all folders just only with ProFilesList. I tried it, and it lists folders just from highest level - from server: wtpub://sip7/. So you can go through Products and Libraries into the deep levels. No ProServerContextsCollect is needed.
PZ
Yes. It should be the case. Traverse from server itself. Additionally; within contexts, we get work-space also as sub directories. So, these sub directories should be excluded by collecting all workspace name. Is this correct approach?
Of course, you don't care about WSs. What about "Site" it's up to you...
BTW: I don't think you are able to get models from this wtpub WSs. To get models from WS via ProFilesList you can scan only active workspace path (wtws://).
Beacause wtpub://sip7/Workspaces/wsname/ don't list data -> ProFilesList do the same as Open dialog:
PZ