RCH_Projects
Alibre Super User
from: viewtopic.php?f=28&t=10724&p=66742&hilit=configuration#p66742
I am coding in VBA for Excel (2007 at the moment).
I've been eyeing Alex Franke's codecreations for some time now to see if his samples come back up but I don't see it happening.
It is easy enough to change the "active configuration", to loop through the values but is very undesirable.
It updates the files and there are times when applying the wrong configuration can create incidental havoc on an assembly or part.
With polish I'll share the excel utility so I really don't want to use bad practices.
There is a chance of adapting the VBA code to Visual Studio basic to interact with the free spreadsheets so I want reliable code worked out first.
I've tried cloning byval with class and memento techniques but where I use the "xcopy" references the source parts/assembly update as well.
I preserve the AD structures to avoid a lot of code overhead which may prevent the clone barrier from standing.
While my current goal is a good inquiry utility it can be expanded to "updating" with Excel code. A good Clone/unmodified image of session or hook would make this simple.
Implementing the Object.MemberwiseClone Method might give a good solution if a DeepCopy() approach works.
The trouble is the translation or conversion from other languages.
I've put in a lot of time on what is probably already solved by others.
If you have something worked out, whatever language, post it up and maybe I can adopt it.
I've tried variations on techniques from the web but something is defeating me.
With other code to work on I need to cut it off without some insight, and it wont be a disaster to me to use my utility, so if there is a clear problem with the code approach below shout out.
Even a good "why" or "wherefore" would help.
start of standard module:
Class module "xPcoAD_L31Part_DesignSession":
Code implementation in standard module:
Properly implemented that last line should not update the actual, or "source", AD records/files.
Thanks for any info.
Roger
WoodWorks said:...
I am basically converting Alex Franke's sample program (Version, Loop through and Count/Display Configurations).
My main problem is the looping through the Configurations.
It is the basis of most of my Parameter and Configuration programs. I have them running in Visual Basic, but I
think IronPython might have some advantages, and wish to learn more. Thanks
I am coding in VBA for Excel (2007 at the moment).
I've been eyeing Alex Franke's codecreations for some time now to see if his samples come back up but I don't see it happening.
It is easy enough to change the "active configuration", to loop through the values but is very undesirable.
It updates the files and there are times when applying the wrong configuration can create incidental havoc on an assembly or part.
With polish I'll share the excel utility so I really don't want to use bad practices.
There is a chance of adapting the VBA code to Visual Studio basic to interact with the free spreadsheets so I want reliable code worked out first.
I've tried cloning byval with class and memento techniques but where I use the "xcopy" references the source parts/assembly update as well.
I preserve the AD structures to avoid a lot of code overhead which may prevent the clone barrier from standing.
While my current goal is a good inquiry utility it can be expanded to "updating" with Excel code. A good Clone/unmodified image of session or hook would make this simple.
Implementing the Object.MemberwiseClone Method might give a good solution if a DeepCopy() approach works.
The trouble is the translation or conversion from other languages.
I've put in a lot of time on what is probably already solved by others.
If you have something worked out, whatever language, post it up and maybe I can adopt it.
I've tried variations on techniques from the web but something is defeating me.
With other code to work on I need to cut it off without some insight, and it wont be a disaster to me to use my utility, so if there is a clear problem with the code approach below shout out.
Even a good "why" or "wherefore" would help.
start of standard module:
Code:
Type MyDesignSession
xCopy As IADDesignSession
End Type
Class module "xPcoAD_L31Part_DesignSession":
Code:
Private Pass_L31Part_DesignSession As MyDesignSession
Public Property Get xCopy() As IADDesignSession
Set xCopy = Pass_L31Part_DesignSession.xCopy
End Property
Public Property Let xCopy(ByVal IADDesignSessionCopy As IADDesignSession)
Set Pass_L31Part_DesignSession.xCopy = IADDesignSessionCopy
End Property
Private Sub Class_Initialize()
End Sub
Private Sub Class_Terminate()
End Sub
Code implementation in standard module:
Code:
Dim xPUoAD_L31Part_DesignSession As xPcoAD_L31Part_DesignSession
Set xPUoAD_L31Part_DesignSession = New xPcoAD_L31Part_DesignSession
xPUoAD_L31Part_DesignSession.xCopy = PUoAD_L31Part_DesignSession ' (the part designsession should clone here)
... ...
Set xPUoAD_L31Part_DesignSession.xCopy.ActiveConfiguration = _
xPUoAD_L31Part_DesignSession.xCopy.Configurations.Item(MYv_Configurations)
Thanks for any info.
Roger