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!

PDMWorks API

Status
Not open for further replies.

flatwire

Mechanical
Nov 20, 2003
17
0
0
US
Ok, so I don't know if I'm completely missing the boat here, but...I'm trying to write a VB program to change the descriptions of a few hundred parts in my PDM system. I can log into the vault, take ownership of a document, and access the description of the part, but I can't change the value of the description. In addition, I also have several other custom parameters that I want to change, but have been unsuccessful in doing so. I've tried using the syntax described in the API help, but it just doesn't seem to work: PDMWProperty.Value = pVal

So, if anyone could post a line of code that will simply change the description of a part (in the vault) to the string "NEW DESCRIPTION", I'd be very grateful (this could all be related to the fact that I'm very new to VB). Thanks
 
Replies continue below

Recommended for you

flatwire,
I am not running Advanced Server either. To my understanding you cannot change anything inside the vault through standard API. If you figure this one out let us know. I am sure I could find some use for a tool that would change things inside the vault.


Bradley
 
If you have the description as a custom property of the document I believe you have to access that custom property to change it, i.e.

[get and set the document you want]

PDMWDocument.Properties("Description") = "New Description"
 
engAlright,
How does one link up to the PDM vault to change a property without running Advanced Server?

I looked at the SolidWorks Task Scheduler and I do not see anyway there of updating properties within the vault.


Bradley
 
PDMAdmin,

It may say that on the website, but API is now included with PDMWorks 2005. I'm running it right now, and I don't have a license for advanced server.
 
flatwire & engAlright,
Sounds like to me that flatwire would have to check-out the drawings and part models and change the properties using VB then check them back-in. He could have an admin do a bulk check-in.


Bradley
 
Here is the solution! I'm going to get a document called "test.SLDPRT" and change the description to "SAMPLE DESCRIPTION" (assume I've already connected to the vault as the pdmwadmin with a connection variable called "conn").

Dim part As PDMWDocument
Dim propertiestlist As PDMWProperties
Dim errorcode As Long

Set part = conn.GetSpecificDocument("test.SLDPRT")
part.ChangeOwner ("pdmwadmin")
Set propertieslist = part.Properties
part.Propertiest("Description") = "SAMPLE DESCRIPTION"

errorcode = propertieslist.Update()

part.ReleaseOwnership



So basically, I took ownership of the part, put all of the properties into a variable, changed the description, and then updated the vault to reflect changes I made. The key was updating the propertieslist variable. If you've got any questions, let me know.
 
The problem is that PDMWorks does not expose the names of the properties very well. I have used an approach similar to Flatwire's with success in the past. However, I don't think I took ownership of the document to modify stuff.



Evan T. Basalik, MCSD
--------------------------------
It's all about prioritization...
 
I have problems getting this API to asign value to a selected properties. I tried to follow the above example, but no luck. Anyone else having anyone luck with this macro. I have written a macro the retrieve the custom properties with no problem.
 
Status
Not open for further replies.
Back
Top