Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.


Register Today
COE 2009 Annual PLM Conference & TechniFair

COE DISCUSSION FORUM
Subject: how to retrieve the parent's object ID?

You are not authorized to post a reply.   
Author Messages
SELANIE12

12 Dec 2007 05:48 AM

Hello everybody,

I believe that I'm going to be crazy. I'm using VB6 to control Smarteam. I know how to have the Object ID and the Class ID of a Part or a Product Catia. Great! But I don't find how to have the Parent's project's object ID, and class ID. I seek, but the solution is hided. Furthermore, how to show the Profil Card having a Class Id?... Help!! I want to find it... Thanks

Regards,

Celine, close to be crazy

EMAGNETTO

14 Dec 2007 06:32 AM
Celine, this is not an easy task, and depends on your usage scenario.

What hook are you using to call your custom (User Defined Tool, After Add , etc)?
On which context? (call it from Smarteam Editor, from CATIA Integration, etc).

Usually you cannot rely on links to get this info, as a Part may belong to more than one project (so you won't identify the project you're actually working on).
But there's not a direct way to get your actual project.
Anyway, there's a workaround, but depends on your scenario.

Eduardo
Kwon Dae Son

19 Mar 2008 04:19 PM
Sub RetrieveParents(WorkObject As SmApplic.ISmObject)
Dim QueryDefinition As SmApplic.ISmQueryDefinition
Dim Parents As SmApplic.ISmObjects ' collection of objects

' Define query
Set QueryDefinition = Nothing
' Retrieve all object parents
Set Parents = WorkObject.RetrieveParents(QueryDefinition)

' Check if there are parents for object
If Parents.Count = 0 Then
MsgBox "No parents"
Else
MsgBox "Number of object parents: " & CSTr(Parents.Count)
End If
End Sub
EMAGNETTO

25 Mar 2008 07:53 AM
This code retrieves the parents of an object on a hierarchical tree relation.
The problem is that between Projects and Parts (in fact, any other superclass object) you won't have this kind of relation (usually you'll have at least a Project-Documents relation).
But an object (like a Part) may be linked to more than one project, or to none, depending on what you did and how you saved.

So, like I said, there may be workarounds depending on the scenario.

hakama

02 Apr 2008 05:39 AM

Im using SmarTeam Editor V5R17 and having there a script developed that should help a user to put a new file into SmarTeam. The purpose is that user needs only point a folder in SmarTeam and select a file from a local machine.

Current workflow is:

  1. start to browse "Documents related to : XXXX project" from projects tree
  2. select a folder where you want to add new document
  3. run the script "Add new document" by RMB from User Defined Tools.
  4. select a file from your local machine
  5. press OK
  6. SmarTeam Projects window appears ... select again the Project you were browsing. I want to get rid of this step ...
  7. press OK
  8. The document will be saved & checked in to SmarTeam succesfully

 

Can I somehow find the project info from that "Documents related to : XXXX project" window where the script was launched?

regards, Heikki

HALE


27 Apr 2008 04:29 PM
Heikki,

Just a thought. What if you eliminate steps 1 and 2. This would make the browse in step 6 the only one the user had to deal with. Slightly different order, but the same result.

Regards,
Hale

Badencorp - CATIA/SmarTeam - Installation, Training and Support!
An hour of hard work can often save you 60 seconds on Google.
You are not authorized to post a reply.
Forums > COE Forums > SmarTeam > how to retrieve the parent's object ID?



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)