Dynamic updating of code in a template or drawing

Started by vickey, October 17, 2016, 12:29:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vickey

Hi,

I have written my code  and macros in developer mode of a drawing.
and every time when a user is creating a new drawing I am just creating a copy of that drawing in the background.
but now my problem is that suppose i have 30-40 drawings created and all of those drawings have the same code written in the developer mode.
But if there is some bug in the code or new improvisation in the code or macro then I need to open each and every drawing in developer mode and update its code, which is very time taking and in future I may have more than 1000 of drawings.
So is there some way that i write my code once in a template or a drawing and it automatically updates the code of all the drawings created previously.
Seeking forward for your replies, I am really stuck at this issue.

Thanks in advance,
Vickey

Hey Ken

Vickey:

    Just put your code in a stencil, and distribute that.  You can either just distribute new code as you develop it, or take it a step further and update shapes and stuff.  It's a trick I learned here, and expanded upon ('wrestled with" may be a better description).  But it works very well.  Details at http://visguy.com/vgforum/index.php?topic=4710.

    Hope this helps,

    - Ken


Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

vojo

well wont quite fix that

Shape is copied from stencil to drawing stencil then used.  So
if drawing is done with stencil "cool stuf 2016 10 18"
then 3 months later you fix the bug with stencil "cool stuf 2017 01 15"
Drawing (at least shapes) wont change.

My guestimate, but you would need to rerun any stencil VBA in 01 15 to get changes
(obviously care must be taken that VBA in 01 15 works with stuff in 10 18)

If indeed this is the case, you might be better off making a "pure" VBA stencil
This approach will force the VBA to discover shapes, make changes, etc....ie an orderly disciplined approach
(no sloppy coding RE "hey I wrote this assuming only this stencil")