Skip to Content

How to checkout a model from repository via csharp?

Nov 20, 2017 at 08:58 PM


avatar image

I want to connect to repository and checkout a PDM model into a variable in my c# script. How can I do that?

Let me give an example: I want to get the model "SA17Demo" under "MyFolder" in the repository.

1) When I use "FindChildByPath" method for the complete path to the model, m is null:

PdPDM.Model m = conn.FindChildByPath("MyFolder/SA17Demo", (int)PdPDM.PdPDM_Classes.cls_BasePhysicalModel) as PdPDM.Model;

2) When I use "FindChildByPath" method for the upper folder with foreach clause:

PdRMG.RepositoryFolder folder = conn.FindChildByPath("MyFolder", (int)PdRMG.PdRMG_Classes.cls_RepositoryFolder) as PdRMG.RepositoryFolder;

foreach (PdRMG.StoredObject childObject in folder.ChildObjects)
    // The following line gives error message "System.InvalidCastException";
    modelRep = (PdPDM.Model)childObject;


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers