of course there is buddy.
Direct database modifications.
the EPDM API is basically access to all of their stored procedures in the SQL database.
be careful because solidworks will not fix a database that has been directly updated
so to lock a file you will need to get the document id
this is retrieved from DBO.Documents
but first you need to get the File path from the model
Dim FileName as string = SwModel.GetPathName.
Dim rootFolder as string = 'you can retrieve this or program it in. this in ConisioMasterDB. you will need to know the vault root folder and to do that
also you will get the database name from ConisioMasterDB
execute sql query to ConisioMasterDB
Select VaultName, DatabaseName from ConisioMasterDB.DBO.FileVaults
Use DatabaseName and vault name to strip out the root directory from FileName
generally you will be left with this
Dim DirName a string = system.io.path.getdirectoryName
i am working on a sample project right now. it will get you started at least
First do me a favor. Is the SQL express dataset available to be queried against? If not then my sample may not work especially if it is locked down unlike pdm professional.
I'm not sure. It's only available to the admin but not users I'd assume. I remain interessed in what you are writing so please continue doing that and post it here if you like!
ok. DO NOT USE THIS IT COULD DESTROY YOUR VAULT.
understanding the table links in the PDM Database is key to direct edit. I WILL NEVER SUGGEST THAT ANYONE EVER DO THIS IT IS A TERRIBLE IDEA AND SHOULD NEVER BE DONE.
howerever attached is a text file representing the code i wrote quickly.
i have not debugged nor tested any of the code. just wrote it from what i could see in the database as I will not test this on my end. ever.. Dont do it.
unless your name is Amen Allah Jlili heheheh
take the text to Telerik website to convert to C# if you want.
otherwise just make a new vb project and paste it in a new class.
there are 2 classes
PDMVault and PDMFile
AGAIN I CANNOT STRESS THIS ENOUGH THIS COULD COST YOUR COMPANY THOUSANDS OF DOLLARS AND CAUSE ALL OF YOUR VAULT DATA TO BECOME CORRUPT.
PDMVault.zip 4.1 KB
so i was able to get into the CAD Addin through enterprise and it does have a lock call. i executed it and it does lock the file. however i believe pre selection is required.
so this will toggle check in and out. but it does prompt for a verification screen.
i believe if you select a component in the assembly or if it is just a part or drawing it will attempt to check those files out.
hopefully selecting components automatically selects them in the EPDM Addin.
test it out bud
PDMAddin.swp.zip 10.2 KB