![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Generate code and Build multiple components in one shot Topic Summary: Created On: 7-Feb-2007 14:53 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I would like to know if there is a way to automate the generating code and building multiple components efforts in Rhapsody 6.1. It is rather time consuming when you have to manually generate code and build a component at a time when you have multiple of them. Perhaps VBA would be the way to go?
Any help is greatly appreciated. KN PS: I have searched the forum but couldn't find anything associate with this topic. |
|
![]() |
|
![]() |
|
I have a similar requirement at the moment and the method I'm looking at is calling rhapsody with a script to carry out a sequence of builds - check out the idea in
the C:\Rhapsody\Samples\CppSamples\Command Line Interface Hope this is of some help ![]() Cheers, Garreth. |
|
![]() |
|
![]() |
|
Garreth,
Thanks for the info. I will look into it. If I have further question, I will be back. Kevin |
|
![]() |
|
![]() |
|
Garreth,
I found the file, modified it to run on the Dishwasher example. How do I run the script? Thanks, Kevin |
|
![]() |
|
![]() |
|
Garreth,
I found the way to kick off the script. Here is the next question. The script only "generate EXE" an active component. It doesn't traverse the component lists to execute on other components. Is there a way to use the script to "generate EXE" on a set of specified components? Thanks, Kevin |
|
![]() |
|
![]() |
|
Hi guys
I don't know if this is usefull, but we use a VBA macro to generate/build our exe component and all the lib components that it depends on. Let me know if it is of any interest. (If it does, I might need some time to beautify the code :rolleyes: ) Regards ------------------------- Jesper Gissel Johnson Controls Denmark, Marine Controls |
|
![]() |
|
![]() |
|
jegissel,
I believe this is exactly what I need. I searched for "script" and found Simon posted a script to generate code for every single component in a project: Public Sub generateAllConfigurations() 'Get current project Dim rpy As RPProject Set rpy = getProject 'Save the current active component/configuration Dim cmpSaved As RPComponent Dim cfgSaved As RPConfiguration Set cmpSaved = rpy.activeComponent Set cfgSaved = rpy.activeConfiguration 'Iterate through each configuration in the project Dim cfg As RPConfiguration Dim elt As RPModelElement For Each elt In rpy.getNestedElementsRecursive If TypeOf elt Is RPConfiguration Then Set cfg = elt rpy.setActiveComponent elt.owner.name rpy.setActiveConfiguration elt.name generate End If Next 'Restore the active component/configuration rpy.setActiveComponent cmpSaved.name rpy.setActiveConfiguration cfgSaved.name End Sub I also be able to modify the above script so that I can pick exactly which component I want to code gen for base on the components' names. I am looking for the second part, building the components. It would be great if I can have script which allows me to build all components or a number of selective components. Your help is appreciated. Kevin |
|
![]() |
|
![]() |
|
Hi Kevin,
I've attached the VBA files we use in our projects for building the exe and the dependent libs. I'll leave it up to You to figure it out, but please let me know if you need any help. By the way, if you find a way to avoid the "Wait for build to finish!" message boxes, I would very much like to know! ![]() Regards ------------------------- Jesper Gissel Johnson Controls Denmark, Marine Controls |
|
![]() |
|
![]() |
|
Jesper,
Thanks for the script. I will let you know if I find a way around "Wait for build to finish". Kevin |
|
![]() |
|
![]() |
|
Jesper,
I play around with your VBA a little bit and look like we have to have a script to generate code for all the components and then run your script to build the components? Is my thinking wrong? Do you have instructions on how to use your script? Thanks, Kevin |
|
![]() |
|
![]() |
|
Hi Kevin,
To start from the beginning, you have to do the following: 1. Import the modBuild.bas and frmBuild.frm files into your project. 2. Add a VBA helper with the following parameters: - Name: Build Component (or what you might prefer) - Module: modBuild - Macro name: build - Applicable To: Configuration The way you use the script, is that you right-click the configuration of the component that you wish to build, and then click "Build Component". This invokes a GUI that shows you a list of the components that will be build. When you click OK, a number of "Wait for build to finish" message boxes will appear. These are shown for the same reason that Simon Morrish mentions in the "Multi component dependencies compiler " thread. It is far from elegant, so any suggestions are wellcome. ![]() Please let me know of your experience! Regards ------------------------- Jesper Gissel Johnson Controls Denmark, Marine Controls |
|
![]() |
|
![]() |
|
Jesper,
I will test the idea out later and let you know. Thanks, Kevin |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.