It is currently Tue Feb 07, 2012 8:06 pm

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 6 posts ] 
Author Message
 Post subject: Making a macro available in all models
PostPosted: Fri Mar 13, 2009 4:16 pm 
User avatar

Joined: Thu Sep 13, 2007 7:34 pm
Posts: 397
Location: London
I'm not an expert but I can produce a simple VBA macro to do something in my model, e.g. format a Use Case as per the example in the Essentials Training.

Is it possible to get my macro to be available in all models?


Offline
 Profile  
 
 Post subject:
PostPosted: Fri Mar 13, 2009 4:46 pm 

Joined: Thu Aug 30, 2007 4:31 pm
Posts: 152
Location: Germany
Are you talking about VB or VBA...?
in Rhapsody you can create VB Macros for one project or copy and rename for another project .. With VBA you can and build an exe that can be used in other projects.

If you do not have VBA you can use the JavaAPI with Eclipse for example (unfortunately the documentation for it is pretty poor)

In any way VBA or Java you can use hep files to make them in all projects or profiles available and accessible in the Rhapsody UI
... hope this helps


Offline
 Profile  
 
 Post subject:
PostPosted: Fri Mar 13, 2009 4:58 pm 
User avatar

Joined: Thu Sep 13, 2007 7:34 pm
Posts: 397
Location: London
I'm talking about VBA I think. At least that's what it's called in the Tools menu. As I say, the only experience I have is similar to what is explained in the Essentials Training. There's a FormatUseCase macro there. How do I make that available in a new project?


Offline
 Profile  
 
 Post subject: Own programme using in different projects
PostPosted: Mon Mar 16, 2009 8:00 am 

Joined: Mon Dec 08, 2008 12:52 pm
Posts: 17
Hi all,

you can write your own programme and can use it in different projects. Therefore you can extend the Rhapsody tool. To do this, you can go to the menu item Tools and there to Customize. In this dialog you can add your programme and specify for which element it should be visible, e.g. for a use case. After you have entered your programme there you can use it in every project.

Hope the information helps

Yours
Jan


Offline
 Profile  
 
 Post subject:
PostPosted: Mon Mar 16, 2009 8:18 pm 

Joined: Thu Aug 30, 2007 4:31 pm
Posts: 152
Location: Germany
and for sure the customize toolbar .. forgot that one :-D
Thanks


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 1:16 pm 

Joined: Tue Feb 03, 2009 3:58 pm
Posts: 27
Location: Bonnie Scotland
Surely the answer to the original question is "no, not automatically"?

There are actually two points here: how to create the macro and then how to use it. By creating, I mean the language and API you use; by using I mean how you launch the macro.

Option 1: VBA (export/import) with Tools-macros

The way we've often created and re-used is by creating a macro in Rhapsody VBA, exporting it and then importing it into another Rhapsody project, but the VBA macros are stored in the .vba file with a project, so are not available to other projects.
The macro can be accessed by Tools-VBA-Macros-

Option 2: as 1, but with shortcuts

A way to speed up use of the macro is to use either the Tools-Customize route or a .hep file to set up a shortcut to run the macro. Typically you'd decide to launch the macro on right-click on a particular type of element (a use case for you, I guess).

Option 3: separate VB, needs shortcuts

If you have VB available, you can create an executable, which is what JaMey refers to --- again, shortcuts can be created either by Tools-Customize or the .hep file.
I think that Mickey had VB and VBA reversed: VB is the stuff you'd typically use Microsoft Visual Studio to create; VBA is the stuff in Rhapsody (and many other applications) that you can access via Tools-VBA. Beware that forms cannot easily be created in one and transferred to the other, though code is usually OK.

Option 4: VBA in Word

Another way we have used occasionally is to use VBA in Word to access Rhapsody's API, so that (for example) you can get the macro to work on whatever is the current Rhapsody project. This can be handy in some circumstances, but you may prefer not to rely on Word.

Option 5: Java, using shortcuts

A Java plugin can be created, which will typically run faster than any of the above routes. You need to create shortcuts to access the plugin.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


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:

cron

suspicion-preferred