Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming PDMWorks through Excel 1

Status
Not open for further replies.

rjshahan

Mechanical
Jul 12, 2007
5
0
0
CA
Hi, I am new to eng-tips.com, I recently started working with PDM works, and i am trying to access a file in my vault with excel, i want to lock the file when i press an activeX button in excel, then edit the file, save it and unlock it. i added the pdm works library to VBA (edmInterface.dll) and
i was trying to acces my file.

i notices that there is a data type lEdmVault5 and lEdmVault5 but I am unsure how to link my pre existing vault to this.

 
Replies continue below

Recommended for you

rjshahan,

I am not sure what your point of view is in regards to PDMWorks, but I would never access files in the vault directly and work on them live. The vault is a place that stores and controls files. When a change has to be made to a file, then that file should be checked out of the vault, changed as required, and then checked back in(at the next revision level if required). If you are going to access a file live in the vault(which I do not think you can, or should) then you compromise the purpose of the system that you create when implementing PDMWorks.

Kevin

Take care & have fun!

Kevin
"Hell, there are no rules here -- we're trying to accomplish something." - Thomas A. Edison
 
hi, i have an excel file that serves as a database in the vault. i have another excel file which serves as a sort of an interface, i have these two files communicating but occasionally some data needs to be added to the database file, but i dont want users to have to check out the database file and the interface file, they should check out the interface file and be oblivious of the other file, i am trying to access this database file through VBA in Excel and check out the file make the necessary changes and check it back in. thus limiting control of the file to what i program into the software and not to the user.

im just not sure how to link the

dim vault as lEdmVault5

to my vault and the

dim file as lEDMFile5

to the database file.

 
If you are using Excel to do what PDMWorks can do, what's the point of having PDMWorks? Just store all of your files on a server and use your Excel file.
I think you may eventually open a can of worms.

Chris
SolidWorks 07 4.0/PDMWorks 07
AutoCAD 06
ctopher's home (updated 04-21-07)
 
my project involves only 2 files but there is a whole vault filled with a few million files for other projects that are solidworks based that require PDM Works, the entire system is based on PDM Works
 
I think the OP wants to use Excel to create an automated procedure which checks out a file from the vault, modifies it and checks it back in. This seems like a valid use of the vault and it looks like the PDMWorks API has the functionality to support this.

A good place to look for information is in the API help file installed with SolidWorks. On my system it is located at:
C:\Program Files\SolidWorks 2007\api\pdmworksapi.chm

The following might be good places to look within the API help file:
[ul][li]Get Specific Document Example[/li]
[li]PDMWConnection Object[/li]
[li]PDMWDocument Object[/li][/ul]

Eric
 
Judging from the object names mentioned I would assume rjshahan is using Enterprise, not PDMW Workgroup.

On your enterprise install CD there will be folder called "Support\API", there is a help file on the Enterprise API there.

In the meantime, to initialize the Vault interface:

Dim myVault as IEdmVault7
set myVault = new edmVault5

myVault.login "Name of the Vault","Username","Password"

Or...to login under the users current credentials:

myVault.loginauto "Name of the Vault"

To grab your document interface, you can do it by full path to the document:

Dim myFile as IEdmFile6
Set myfile = myvault.getfilefrompath("FilePath")


Once you have the file interface, there are LockFile and UnlockFile methods to Check the file in and out.

Hope this helps!







 
Status
Not open for further replies.
Back
Top