Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to Update Default.ivb

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
rob.j.ross
2634 Views, 9 Replies

Unable to Update Default.ivb

I am having an issue updating the Default.ivb file to add new VBA macros.  I use the auto run code in the default.ivb file to run our macros.  When I create a new macro I just add the new macro info to default.ivb and everyone can then add the button.  It has worked great for almost 10 years.

 

In the past when I did edit the default.ivb file I had to make sure I was the first one to grab a license in the morning before anyone used a macro or the default.ivb file would be read only.  Now when I edit the default.ivb file and try to save it I get the attached error.  I don't ever remember getting this error before.  Any ideas why I can't edit the file and am getting this message?

____________________________
Inventor Professional 2014 64 Bit
Windows 7 Professional
NVIDIA Quadro FX 4600
Dual Intel Xeon E5540 CPUs
16GB DDR3 Ram
9 REPLIES 9
Message 2 of 10
mr_ensing
in reply to: rob.j.ross

All i can say is, check if

1. the file isn't read only

2. anyone (but you) has Inventor running

 

Message 3 of 10
adam.nagy
in reply to: rob.j.ross

Hi,

 

I've seen that error once, I think. And if I remember right I just had to restart Windows and it disappeared - maybe something locked it.

 

By the way, if you are using Inventor 2014 then Auto macros will not run:

http://modthemachine.typepad.com/my_weblog/2013/07/add-in-with-event-example-to-replace-auto-run-mac...

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 4 of 10
rob.j.ross
in reply to: adam.nagy

Thanks Adam.  Restarting didn't fix it.  It acts like it is read-only but it doesn't show as Read-Only.  Usually when Default.ivb is read only it is indicated in the name like ApplicationProject(Default.ivb - Read Only)

 

What I meant by auto run was using the following code in the Default.ivb file.  Auto run is the wrong name for it but the below still works with 2014.

 

'Main function
Public Sub RunCustomProgram(Filename As String, ProjectName As String, ModuleName As String, FunctionName As String)
    Dim oIvVBAProjects As Inventor.InventorVBAProjects
    Set oIvVBAProjects = ThisApplication.VBAProjects
    Dim j As Integer
    Dim i As Integer
    Dim oIvVBAComps As InventorVBAComponents
    Dim oIvVBAMembers As InventorVBAMembers
    Dim oIvVBAMember As InventorVBAMember
    Dim dd As Object
    
    For i = 1 To ThisApplication.VBAProjects.Count
        Dim cc As Object
        Set cc = ThisApplication.VBAProjects.Item(i)
        If cc.Name = ProjectName Then
            Exit For
        End If
    Next

...

 

____________________________
Inventor Professional 2014 64 Bit
Windows 7 Professional
NVIDIA Quadro FX 4600
Dual Intel Xeon E5540 CPUs
16GB DDR3 Ram
Message 5 of 10
adam.nagy
in reply to: rob.j.ross

Hi,

 

And where do you call RunCustomProgram from? From an addin?

 

Also, where is the VBA file? Is it on your machine and you share it with others or on a server?

The machine storing the file should be restarted - as a test.

You could also try to make a copy of the file in File Explorer and then try to delete it to see if you really have full access to it - not just read.

 

Cheers, 



Adam Nagy
Autodesk Platform Services
Message 6 of 10
mr_ensing
in reply to: rob.j.ross

Maybe a program like WhoLockMe can help find out who (or what process) is locking the file?

Message 7 of 10
rob.j.ross
in reply to: adam.nagy

Adam,

 

The RunCustomProgram code is called from the Default.ivb file.

 

RCPLocation.png

 

This code was posted by someone on this forum a long time ago(couldn't find the post) and I have been using it for about 8 years.  It makes adding and distributing VBA macros very easy and works in Inventor 2014.  The Default.ivb file is on the network so I can point everyone's Application Options to it.

 

The issue was that someone else was locking the Default.ivb file through use of a macro even though it wasn't showing as read-only as it typically does.  I solved it by having our IT department create a batch file that basically kicks everyone out of the Default.ivb file.  You can also do this manually through Windows MMC by Closing Open Files.  When everyone is out, I can now edit the file.  Thanks for the input.

 

mr_ensing, thanks for the link.  I will check it out.

 

____________________________
Inventor Professional 2014 64 Bit
Windows 7 Professional
NVIDIA Quadro FX 4600
Dual Intel Xeon E5540 CPUs
16GB DDR3 Ram
Message 8 of 10
Boorda
in reply to: rob.j.ross

I know this is already answered but anyone using Vault can get around the "Read Only" issue by managing the .ivb file like you would any cad model. We have a Managed Scripts folder in our vault and our main macro file is kept there. If anyone needs to make a change it has to be checked out. You can then make your changes, check it back in and have everyone else do a "Get" on the macro file from Vault. Just remember that anyone needing to do a get on the new macro file must do so before opening Inventor. I also like this method because I have versioning on the file and can track changes or roll back if needed.

Automation is key!
Message 9 of 10
rob.j.ross
in reply to: Boorda

Keeping the file in vault is a good idea.  Thanks for the suggestion.  Your Application Options point to the local copy of the Default.ivb?

____________________________
Inventor Professional 2014 64 Bit
Windows 7 Professional
NVIDIA Quadro FX 4600
Dual Intel Xeon E5540 CPUs
16GB DDR3 Ram
Message 10 of 10
Boorda
in reply to: rob.j.ross

Yes my application options point to the where the Vault downloads the .ivb file to.

Automation is key!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report