Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Product Update Status 1

Status
Not open for further replies.

MsuMsu

Mechanical
Jan 6, 2021
14
I have problem with finding update status in Catia V5. I cant find if the product needs update. How can i find product update status?


Here you can find how i find part update needs.

For Each dokumanlar In CATIA.Documents
If TypeName(dokumanlar) = "PartDocument" Then
If dokumanlar.Part.IsUpToDate(dokumanlar.Part) = False Then
SaveveUpdateKontrol = True
Exit Function
End If
End If
Next
 
Replies continue below

Recommended for you

Double click on product and check the update button status . Am i missing something ? Why you need a code for this ?
 
Actually you can use Part.IsUpToDate to check update status of objects of any type including Product.
 
What if changing constaints of the products ?
 
Can you write the codes in your mind please. Because i cant find the way for products. Here you can find the code for part.

PartUpdateNeed = CATIA.ActiveDocument.Part.IsUpToDate(CATIA.ActiveDocument.Part)
 
Code:
Dim part
Dim doc: for each doc in CATIA.Documents
  if TypeName(doc) = "PartDocument" then
    set part = doc.Part
    exit for
  end if
next

Dim isUpdated
for each doc in CATIA.Documents
  isUpdated = true
  if TypeName(doc) = "PartDocument" then
    isUpdated = part.IsUpToDate(doc.Part)
  elseif TypeName(doc) = "ProductDocument" then
    isUpdated = part.IsUpToDate(doc.Product)
  end if
  if not isUpdated then
    MsgBox "Document " + doc.Name + " is not up to date"
  end if 
next
 
I need to solve one more update problem. Could you please help me to find how i determine drawing update needs ?
 
IsUpToDate doesn't work well with drawing generative views. And specialized code is not available in VB, only in CAA.
 
Little Cthulhu, do you have any code or links for determining drawing update needs?
 
we can access to caa but i don't know to use
 
Well, I'm afraid I'm not going to teach you that. Hiring a contractor is the best option I guess.
 
Little Cthulhu said:
[pre]IsUpToDate doesn't work well with drawing generative views. And specialized code is not available in VB, only in CAA.[/pre]
Any idea what is the CAA Api for this? I tried the IsUptoDate on CATISpecObject for the drawing and did not get the result.
 
You should retrieve applicative extension and then query it to CATISpecObject:

Code:
CATIDftView* piView; // your generative view
IUnknown* iuGenView = NULL;
piView->GetApplicativeExtension(IID_CATIDftGenView, &iuGenView);
CATISpecObject* piSpecObject = NULL;
iuGenView->QueryInterface(IID_CATISpecObject, (void**)&piSpecObject);
 
Hi Little Cthulhu

We wrote code for determining drawing update needs as you see below. When we play the code with F8, it works. But when we run the code automaticaly, it doesn't work. Do you have any idea for this problem.

Code:
 Function DrawingUpdateNeed() As Boolean
    Dim doc As Document
    Set doc = Catia.ActiveDocument
    doc.Update

    SaveNeed = doc.Saved
    If SaveNeed = False Then
        DrawingUpdateNeed = True
        Exit Function
    End If

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor