Sync Revision Properties between Models & Drawings with iLogic

Sync Revision Properties between Models & Drawings with iLogic

nsayer_d42
Contributor Contributor
548 Views
1 Reply
Message 1 of 2

Sync Revision Properties between Models & Drawings with iLogic

nsayer_d42
Contributor
Contributor

Hi World. First ever post here, so please be gentle. I'm relatively new to iLogic, and am probably asking for something which cannot be done...

 

I've written a small piece of code which works as an external rule, linked to drawings so that it copies the Revision number to the associated part or assembly when saving:

 

Dim oModelDoc As Document = ThisDoc.ModelDocument

Dim oModelName As String = IO.Path.GetFileName(oModelDoc.FullFileName)

'Copy Revision iProperties from Drawing Document to Model
'Tested for Parts and Assemblies
iProperties.Value(oModelName, "Summary", "Revision Number") = iProperties.Value("Summary", "Revision Number")

InventorVb.DocumentUpdate(True)

 

It works well, generally, but when used with Vault, it relies on the end user remembering to have both drawing and model checked out... and when checking things back in, it only works if the drawing is checked in first... additionally when parts and assemblies are involved, it has to be the parts being checked in first, or Inventor doesn't like it.

 

Is there maybe a Vault setting I am not aware of which could help manage this?

 

Is there a little bit more code that could assist?

 

The Vault type in use is the basic version, and each model (part or assembly) has it's own drawing.

0 Likes
549 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

Welcome to the forum. I had a quick look at your topic, I am no expert.  It looks like the status your looking for is a tricky one and may involve addins or knowledge of the API. 

But there is a read only status you can check sourced from this post.

I am guessing if you check the status and it is read only it means that it is not available for editing and you can notify the user. 

The last link in that post has a larger rule to call this function in a different way. 

Referenced forum Post:

Here is the function that returns true or false if the file is read-only or not. No additional references are needed.

Private Function IsFileReadOnly(sFile) As Boolean
     ' Test to see if the Read-only attribute was assigned to the file.

    If GetAttr(sFile) And vbReadOnly Then
        IsFileReadOnly = True
    Else
       IsFileReadOnly = False
    End If

End Function

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes