Ehaviv
Computer
- Jul 2, 2003
- 1,012
Hi
I'm Confused because. I think
for this if
-----------------------------------------------------------------------
This function shold work
-----------------------------------------------------------------------
And not this. (actualy in my test on nx manager this work. why?
Thank you in advanced
============================================================================
NxOpen API doc
I'm Confused because. I think
for this if
Code:
If ItemAlreadyExists Then
MsgBox("PartNumber Already Exists in TC")
End If
-----------------------------------------------------------------------
This function shold work
Code:
Public Function ItemAlreadyExists(ByVal item_id As String) As Boolean
Dim ufs As UFSession = UFSession.GetUFSession()
Dim item_already_exists As Boolean = False
Dim database_part_tag As Tag
ufs.Ugmgr.AskPartTag(item_id, database_part_tag)
If database_part_tag = Nothing Then
[b]item_already_exists = True[/b]
End If
Return item_already_exists
End Function
And not this. (actualy in my test on nx manager this work. why?
Code:
Public Function ItemAlreadyExists(ByVal item_id As String) As Boolean
Dim ufs As UFSession = UFSession.GetUFSession()
Dim item_already_exists As Boolean = True
Dim database_part_tag As Tag
ufs.Ugmgr.AskPartTag(item_id, database_part_tag)
If database_part_tag = Nothing Then
[b]item_already_exists = False[/b]
End If
Return item_already_exists
End Function
Thank you in advanced
============================================================================
NxOpen API doc
Code:
UF_UGMGR_ask_part_tag (view source)
Defined in: uf_ugmgr.h
Overview
Finds the tag of a part in the database corresponding to the specified
part number.
In case of Default Domain: it is Team Center Engineering item ID.
In case of non-Default Domain: it is the multifield key.
e.g. ,=item_id=001, object_type=Document
,=item_id=001, object_type=SupplierPart, supplier_code=x
If the function is successful, the output
argument contains the database tag of the part. If the function is
unsuccessful, then the output argument is UF_UGMGR_null_tag.
Environment
Internal and External
Required License(s)
gateway
int UF_UGMGR_ask_part_tag
(
char * part_number,
UF_UGMGR_tag_t * database_part_tag
)
char *
part_number
Input
Part number.
UF_UGMGR_tag_t *
database_part_tag
Output
Database tag of the part corresponding to
the specified part number.