×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

PDMWorks API

PDMWorks API

PDMWorks API

(OP)
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

RE: PDMWorks API

flatwire,
Do you have PDM Advanced Server?

Bradley

RE: PDMWorks API

(OP)
Bradley, I don't have advanced server.  I am running 2005, which gives me access to API, but not triggers (i believe).

RE: PDMWorks API

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

RE: PDMWorks API

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"

RE: PDMWorks API

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

RE: PDMWorks API

(OP)
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.

RE: PDMWorks API

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

RE: PDMWorks API

(OP)
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.

RE: PDMWorks API

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...

RE: PDMWorks API

(OP)
Evan is right, you don't need to take ownership of the document in order to change the properties.

RE: PDMWorks API

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources