我想从其他应用程序打开/启动SolidWorks PDM中的文件夹。
我正在使用C#并使用以下代码:
#ifdef FOLD Struct MyFileStruct
#pragma pack(1)
typedef struct MyFileStruct {
WCHAR fileName[FILENAMELEN]; // File name
WCHAR fileInfos[32]; // File info
WCHAR fileDate[32]; // File date
DWORD sizeInBytes; // File size
} File;
#pragma pack()
#endif
沙箱目录是一个View目录。 当我手动导航到该目录时,它将登录到Vault并按应查看的所有目录。
执行上面的代码时,我只得到目录的浏览器,但没有PDM功能。
有什么方法可以做到这一点?
答案 0 :(得分:2)
您可以使用在安装PDM客户端时处理的conisio链接。链接的格式如下:
conisio://<vaultname>/<action>?projectid=<ProjectID>&documentid=<DocumentID>&objecttype=1
action
是explore
。
您显然需要知道文件夹/项目ID,但是您可以使用系统中未删除的任何文档ID。只需将该字符串传递到Process.Start()
。
Process.Start("conisio://Sandbox/explore?projectid=1005&documentid=7543&objecttype=1");
作为参考,以下是其他操作。
Where:
<vaultname> is the name of the file vault
<ProjectID> is the database ProjectID of the folder where the file is located in the vault
<DocumentID> is the database DocumentID of the file
<action> is one of the following:
open – Opens the file in associated application
view – Opens the configured “Viewer” application for the file
explore – Opens an explorer window in the folder the file resides and selects the file
get – Triggers a Get of the file to the local file vault view
lock – Checks out the file
properties – Brings up the file properties
history – Brings up the file history