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: 

editing macro

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
akosi
599 Views, 7 Replies

editing macro

my macro is shared and used by a group of people. i cannot edit the macro if someone is using it.

is there a way to be able to edit it even if people are using it?

 

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: akosi

Here is what I do:

 

I have two folders for the macros.  One for development or debugging and one for production or release.  I make all my edits to the versions in the development folder then publish or save copy as to the release folder.  Since the versions in the development folder are not the ones being used they are always read/write.

 

If a macro crashes on someones computer you will need to go to that computer and unload it before saving a new version to the production folder.

 

Hope that helps.

 

***EDIT - Make sure you are automatically unloading the macros when they are finished.

Message 3 of 8
akosi
in reply to: Anonymous

well , thats what ive been doing.

but when i need to save it to the release folder , i wont be able if someone is using it.

 

is there a way that it will always be available to me and readonly to them?

Message 4 of 8
Anonymous
in reply to: akosi

I do not believe there is a way to do what you are describing.  I typically only have this problem with the Default.ivb file when I need to add an auto run sub for a new macro.  If someone gets into Inventor before me and runs a macro then Default.ivb becomes read-only.  Most of our macros are used then unloaded so users are not in them for extended periods of time.

Message 5 of 8
ekinsb
in reply to: Anonymous

I don't know if this solves this particular problem but I have heard before of people making the VBA project read-only (using Windows Explorer).  In this case it was so that no one else could edit it but it might also allow it to be replaced.  It's worth trying.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 6 of 8
Anonymous
in reply to: akosi

As you have found out you cannot edit your VBA project whiie someone is using it.

 

This is a Windows restriction.

 

What I do:

 

For myself I wrote a small VB.NET app that takes several path parameters and remembers them.

When I push a sychronize button This app copies the existing MasterInventor.ivb to an archive folder adding the date and time stamp to the file name.  Then the app takes my VBA development project and overwrites  the current MasterInventor.ivb with it.

 

For my users each of whom have personally named vba projects  I wrote a second similar app that overwrites their personal VBA projects with the MasterInventor.ivb file. The users only run this app when I send them an email to do so.

 

Both apps are only run when Inventor or Autocad are shut down.

 

What this does is make updates a one button push for both myself and my users.

Our Network VBA Project folder look something like the following.

 

AaronZ.ivb

FloydH.ivb

JohnB.ivb

JenC.ivb

MasterInventor.Ivb

<Me>.ivb

Etc...

Message 7 of 8
jdkriek
in reply to: akosi

Here's my solution that has worked out well: The intial icon for Inventor and AutoCAD point to a .cmd file that copies the master VBA project from the network to thier local drive. All users are pointing to their local copy of the project, so no one but me is pointing to the Master. After the copy it simply starts Inventor.

 

Here's an example:

 

@ECHO OFF 

:: VBA Project Copy Example
C:
DEL "C:\Local Files\Master.ivb"
COPY /Y "\\network\VBProject\Master.ivb" "C:\Local Files"

:: Start Inventor 
START /B "" "C:\PathToInventor\Inventor.exe"

EXIT
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 8 of 8
Boorda
in reply to: akosi

We have a Managed Scripts folder setup in Vault where we keep the master .ivb file.

When you do a "Get" from Vault it copies the file to the local machine like any other Inventor file assuming you have your project setup correctly.

As an extra precaution the Vault Administrator keeps the file checked out so that other users cannot accidentally check it out.

 

With this method you do have to alert users to do a "Get" on the file from Vault when you have checked in changes but, it also gives you versioning on the file.

Versioning is important if you ever need to roll back because users are having serious issues with a macro or there was an accidental change.

 

We went away from the icon pointing to the .cmd file because it requires the user to make sure they are clicking on the correct icon.

Which means there is a possibility that a user will click on a default icon negating all that extra work.
We also found it a pain to maintain and distributed the modified icon every time you upgrade Inventor or make a change.

And lastly, you don't get versioning.

 

 


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