It is currently Sat May 25, 2013 6:47 am

All times are UTC





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Dec 04, 2007 9:10 am 
Offline
MCAD Lurker

Joined: 25 Jan 2007
Posts: 3
Hi Inventor coders...

I have the following problem and could not find a hint how to solve it with the search engine...

I put a password on my VBA project inside an IPT. In a module called "Konfigurator" I have the sub AutoSave(). Since there is the password set this sub is not being called on saving.

I can start the AutoSave() by hand with set password and it works fine.

When I open the VBA editor and enter the passwort AutoSave() works as it should. Even when I close the VBA editor. When the part ist closed an reopened AutoSave() will not work again.

Is there a hotfix or workaround for this? My Excel VBA works just fine with password on the XLS's project.

Thanks for your assistance!

Chris

AIP11 with SP3 on WinXP Pro SP2


Share on FacebookShare on TwitterShare on DiggShare on DeliciousShare on TumblrShare on Google+
Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 04, 2007 3:24 pm 
Offline
MCAD Addict
User avatar

Joined: 22 Mar 2004
Posts: 530
Country: United States
State: Pennsylvania
CAD System: Inventor
Chris:

Unfortunately, I can't offer a solution. You might want to ask yourself why you need/want to password-protect this code in the first place though as this type of "security" is easily circumvented. Also consider the oft repeated advice around here about not embedding code in your Inventor files. Have you considered implementing this as an Add-In? It is far more secure and stable than using Document VBA modules.

_________________
Robert A. Williams
http://www.leacar.com
"Gentlemen...you can't fight here. This is the War Room!"


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 04, 2007 4:15 pm 
Offline
MCAD Lurker

Joined: 25 Jan 2007
Posts: 3
Hi Robert,

the only reason why I am not building an addin is because I do not know how. ;)

The VBA code is used to calculate iProperties from Parameters before saving. How can the password be circumvented?

The VBA does some case-ing and string manipulating... We use this in our templates. It is very lightweight, only one module, no forms... Is only called if part needs an update while saving.

Is there a newbie-how-to for building addins? Do I need some special applications for this?

Thanks

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 5:10 am 
Offline
MCAD Addict
User avatar

Joined: 22 Mar 2004
Posts: 530
Country: United States
State: Pennsylvania
CAD System: Inventor
Chris:

Here is a post I made a few years ago showing how to implement events in the default.ivb file. You could implement the OnSaveDocument event to accomplish what you are doing now. Putting this code in the default.ivb avoids the pitfalls of code in your Part files.

http://discussion.autodesk.com/adskcsp/ ... ID=3613627

As far as Add-Ins go, you will need Visual Basic 6 or Visual Studio .NET before getting started. There is a short but informative section in the API help file on how to write and implement an Add-In.

_________________
Robert A. Williams
http://www.leacar.com
"Gentlemen...you can't fight here. This is the War Room!"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
POWERED_BY