Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi guys
Good Morning
is there any Api call is available for reading or retrieving the model from the windchill workspace?
Please let me know if you know any other Possibilities.
regards
Aravind
Solved! Go to Solution.
Then use ProFileList
Workspace you may enter wtws://
For the CommonSpace try to enter the url, I never tested this, but this could work, You will get files and folders back.
Use the url you see in the Browser, afik
wtws://
extern ProError ProFilesList (ProPath directory_path,
ProLine filter,
ProFileListOpt listing_option,
ProPath **p_file_name_array,
ProPath **p_subdir_name_array);
/*
Purpose: Lists the files in the specified directory. You can pass specific
filters to get files with those extensions only.
Input Arguments:
directory_path - The directory in which to look for
the files to be listed. If this is NULL,
the files from the current directory will be
listed.
filter - The user-supplied filter string for file
extensions. Each filter must be separated
by a comma. For example, "*.prt,*.txt"
(converted to a wide-character string).
Each individual element in the filter must
be less than PRO_NAME_SIZE characters.
listing_option - Specifies whether all versions or only the
latest versions are being requested, and whether or
not the list should be sorted alphabetically.
<b>Note: </b>Passing any of _INST options
in Wildfire 4.0 M100 and earlier will have the same
effect as passing PRO_FILE_LIST_LATEST.
Output Arguments:
p_file_name_array - The array of files found. You must preallocate
this array using <b>ProArrayAlloc()</b>; if you
reuse the array, new elements will be appended to
the existing elements unless you reset the array
size to 0 with ProArraySizeSet.
p_subdir_name_array - The array of all subdirectories found,
regardless of whether they match the filter.
You must preallocate this array using
<b>ProArrayAlloc()</b>; if you reuse the array,
new elements will be appended to the existing
elements unless you reset the array size to 0 with
ProArraySizeSet.
Return Values:
PRO_TK_NO_ERROR - The function successfully returned the files.
PRO_TK_BAD_INPUTS - One or more of the input arguments are invalid.
PRO_TK_INVALID_DIR - Invalid directory.
See Also:
ProArrayAlloc()
to read
extern ProError ProMdlFiletypeLoad (ProPath full_path,
ProMdlfileType type,
ProBoolean ask_user_about_reps,
ProMdl *p_handle);
/*
Purpose: Retrieves the specified model and initializes the handle.
<p>
The function retrieves the model
into memory, but neither displays the model nor
makes it the current model. Differs from ProMdlnameRetrieve
in that the caller can specify the location of the model
in addition to its name.
<p>
If retrieving an assembly, and errors occur in regeneration,
the assembly will include suppressed features. The function
ProSolidRetrievalErrorsGet identifies if errors occurred.
Input Arguments:
full_path - The full path of the model to be retrieved,
including the name, and optionally the location
and extension.
type - The type of the model to retrieve, or PRO_MDLFILE_UNUSED
if full_path includes an extension.
ask_user_about_reps - If TRUE, the Open Rep dialog may be presented,
allowing the user to specify which simplified
representation of the model should be retrieved.
Output Arguments:
p_handle - The handle to the retrieved model
Hi RPN
thanks for your response
but i need to get or read all the model in windchill, is that possible?
If you have the model name and type like box.drw, just open it.
Search order is
The last could be current working folder and your search path info, but with Windchill you should not have this.
So just open/read the file, if not found you will get a relevant return status from the function call.
no i don't know the model names, just i want to read all the model from workspace.
Then use ProFileList
Workspace you may enter wtws://
For the CommonSpace try to enter the url, I never tested this, but this could work, You will get files and folders back.
ok, I'll try.
Thank you 😊