Macro on startup

Macro on startup

Post by Sirer » Sat, 22 Jun 2002 10:58:00



I have a special macro that I'd like to run only on occasion.
Can a batch file be used to call MicroStation and force it to run
my special macro vs. the macro that is set in the config file, that I do
want to run 95% of the time?

Thanks!
Johnny

 
 
 

Macro on startup

Post by Simon Wurste » Sun, 23 Jun 2002 06:19:25


Hi Johnny,

You could test for a variable, then define another that your macro tests
for.

In your PCF/UCF/CFG or wherever:

%if $(USERNAME) = "SSPEILBERG"
        MINORITY_REPORT = 1
%else
        MINORITY_REPORT = 0
%endif

If the user is Speilberg, the var MINORITY_REPORT is set to 1. Now for
the macro:

...
Dim keyWord As String
Dim Oscar As Integer
keyWord = MbeGetConfigVar ("MINORITY_REPORT")
If keyWord = "1" Then
        'do special case stuff here:
        Oscar = True
        ...
Else
        'do regular stuff here:
        Oscar = False
        ...
End If
...

The macro tests for the value of MINORITY_REPORT as a basis for the
branching in the If statement. You may find that you'll need to combine
your two macros into one, each one inserted in the proper part of the If
statement above.

HTH,
Simon


> I have a special macro that I'd like to run only on occasion.
> Can a batch file be used to call MicroStation and force it to run
> my special macro vs. the macro that is set in the config file, that I do
> want to run 95% of the time?

> Thanks!
> Johnny


 
 
 

Macro on startup

Post by Robert.M » Sat, 29 Jun 2002 21:37:00


I love the variable you use Simon..always unique!

I get a little caught up in it all when I'm writing that I forget to have
fun with the variables at times....

Cheers!

?

--

Regards


It's no secret that a client, can sometimes be a pest
It's no secret that a deadline, bites the nails of success


: Hi Johnny,
:
: You could test for a variable, then define another that your macro tests
: for.
:
: In your PCF/UCF/CFG or wherever:
:
: %if $(USERNAME) = "SSPEILBERG"
: MINORITY_REPORT = 1
: %else
: MINORITY_REPORT = 0
: %endif
:
: If the user is Speilberg, the var MINORITY_REPORT is set to 1. Now for
: the macro:
:
: ...
: Dim keyWord As String
: Dim Oscar As Integer
: keyWord = MbeGetConfigVar ("MINORITY_REPORT")
: If keyWord = "1" Then
: 'do special case stuff here:
: Oscar = True
: ...
: Else
: 'do regular stuff here:
: Oscar = False
: ...
: End If
: ...
:
: The macro tests for the value of MINORITY_REPORT as a basis for the
: branching in the If statement. You may find that you'll need to combine
: your two macros into one, each one inserted in the proper part of the If
: statement above.
:
: HTH,
: Simon
:
: >
: > I have a special macro that I'd like to run only on occasion.
: > Can a batch file be used to call MicroStation and force it to run
: > my special macro vs. the macro that is set in the config file, that I do
: > want to run 95% of the time?
: >
: > Thanks!
: > Johnny

 
 
 

Macro on startup

Post by Simon Wurste » Sun, 30 Jun 2002 06:44:27


Ahh, but the true creativity is with 6 character cell names. Too bad V8
came out--all these pre-V8 quirks would have made a great board game,
like Monopoly.
--"Go to EOF Missing Jail. Do not Pass Go, pay extra $650 Select Fee"
--"Your cell library matches clients working units. Extra turn."

If the day only had 30 hours...
Simon


> I love the variable you use Simon..always unique!

> I get a little caught up in it all when I'm writing that I forget to have
> fun with the variables at times....

> Cheers!

> ?

> --

> Regards

> ?obert


> It's no secret that a client, can sometimes be a pest
> It's no secret that a deadline, bites the nails of success



> : Hi Johnny,
> :
> : You could test for a variable, then define another that your macro tests
> : for.
> :
> : In your PCF/UCF/CFG or wherever:
> :
> : %if $(USERNAME) = "SSPEILBERG"
> : MINORITY_REPORT = 1
> : %else
> : MINORITY_REPORT = 0
> : %endif
> :
> : If the user is Speilberg, the var MINORITY_REPORT is set to 1. Now for
> : the macro:
> :
> : ...
> : Dim keyWord As String
> : Dim Oscar As Integer
> : keyWord = MbeGetConfigVar ("MINORITY_REPORT")
> : If keyWord = "1" Then
> : 'do special case stuff here:
> : Oscar = True
> : ...
> : Else
> : 'do regular stuff here:
> : Oscar = False
> : ...
> : End If
> : ...
> :
> : The macro tests for the value of MINORITY_REPORT as a basis for the
> : branching in the If statement. You may find that you'll need to combine
> : your two macros into one, each one inserted in the proper part of the If
> : statement above.
> :
> : HTH,
> : Simon
> :

> : >
> : > I have a special macro that I'd like to run only on occasion.
> : > Can a batch file be used to call MicroStation and force it to run
> : > my special macro vs. the macro that is set in the config file, that I do
> : > want to run 95% of the time?
> : >
> : > Thanks!
> : > Johnny

 
 
 

1. VBA macro at ACAD startup?

Hi all.

I know it is possible to modify the ACAD command line in order to
automatically apply a script at ACAD startup (/b switch I believe...).

Since I'm no where near programming in lisp, is there a way to do the
equivalent but instead of a lisp script, I'd like to execute a macro defined
in VBA when starting ACAD.

Thanks!

2. Gabriel Knight 2-The Beast Within

3. how to start a vba macro at autocad startup?

4. Determine parameters at run-time

5. Automatically run a SW Macro upon Startup

6. Mix "green screen" and Client/Server applications

7. File startup macro

8. FS: 525Mb Archive QIC tape drive & Sony CDROM drive

9. How to start a macro automatically at application startup

10. Calling Macro's within Macro's????????????????????

11. more questions on macros from another macro newbie

12. Custom icons with macros or assign macros to keys?

13. Help passing info macro-to-macro