VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AUTOVBALOAD.LSP by Tony Tanzillo

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
259 Views, 7 Replies

AUTOVBALOAD.LSP by Tony Tanzillo

Hi All (& Tony if you're around)

in the following Tony said "executes a macro
defined in the DVB file."

But for the life of me I can't get the routine to run.

http://www.caddzone.com/autovbaload.lsp

I've tried it out from a toolbar with:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

The command is created - if I type fxBreakLine at the command line it does execute.

Any ideas how can I get it to work when AutoVBALoad is executed?

Cheers in advance.

Dave F.
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

Just realized I've posted it in (kind of ) the wrong NG.

However, if anybody here knows...?

Ta
Dave F.
Message 3 of 8
Anonymous
in reply to: Anonymous

Not sure why you're putting that in a toolbar.

The toolbar button macro should only execute
the command, not call the LISP that defines the
command.

Put the code in a file that's loaded at startup
(like your .MNL file) and make sure your DVB
has a macro called 'ThisDrawing.fxBreakLine'.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Dave F." wrote in message news:5784157@discussion.autodesk.com...
Hi All (& Tony if you're around)

in the following Tony said "executes a macro
defined in the DVB file."

But for the life of me I can't get the routine to run.

http://www.caddzone.com/autovbaload.lsp

I've tried it out from a toolbar with:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

The command is created - if I type fxBreakLine at the command line it does execute.

Any ideas how can I get it to work when AutoVBALoad is executed?

Cheers in advance.

Dave F.
Message 4 of 8
Anonymous
in reply to: Anonymous

Tony Tanzillo wrote:
> Not sure why you're putting that in a toolbar.
>
> The toolbar button macro should only execute
> the command, not call the LISP that defines the
> command.
>
> Put the code in a file that's loaded at startup
> (like your .MNL file) and make sure your DVB
> has a macro called 'ThisDrawing.fxBreakLine'.
>

Hi Tony

There appears to be some confusion.
The routine is in my acaddoc.lsp.

The ToolBar Icon was calling this:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

I was under the impression that this would run the macro called fxlinebreak.

However it seems I need to call it like this:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil);fxBreakLine

Is this correct?

Not sure what the significance of ThisDrawing is. I only use that within my macro.
What is it for?

Thanks for your help.

Cheers
Dave F.
Message 5 of 8
Anonymous
in reply to: Anonymous

Be sure to have a file called ACAD.RX in your search path.
That (text) file must have the line :

ACVBA.ARX

this will tell autocad to load the VBA environment.

In vba editor with NEW , create

ACAD.DVB

go to the Visual Basic Editor

under THIS DRAWING you will see the file ACAD.dvb

put there the lines:


Sub ACADStartup()

Call AcadApplication.LoadDVB("fxBreakLine.dvb")

End Sub


At the toolbar use the command:

(command "vbarun" "fxBreakLine")

That will run your macro.

Every time autocad starts up it will load the program(s) mentioned under Sub
ACADStartup().
You only need to call the right macro.

This is how I do all my VBA macro's.

Lol.





"Dave F." wrote in message
news:5784157@discussion.autodesk.com...
Hi All (& Tony if you're around)

in the following Tony said "executes a macro
defined in the DVB file."

But for the life of me I can't get the routine to run.

http://www.caddzone.com/autovbaload.lsp

I've tried it out from a toolbar with:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

The command is created - if I type fxBreakLine at the command line it does
execute.

Any ideas how can I get it to work when AutoVBALoad is executed?

Cheers in advance.

Dave F.
Message 6 of 8
Anonymous
in reply to: Anonymous

Perhaps you should try to understand what the purpose
of 'autoloading' is. The purpose is to eliminate the need
to load a DVB file at startup, and only load it if/when you
actually need it.

AutoVBALoad is one way to achieve that, because it lets
you have many DVB files that are only loaded if they're
needed, but are never loaded otherwise.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"The Marker" wrote in message news:5784834@discussion.autodesk.com...
Be sure to have a file called ACAD.RX in your search path.
That (text) file must have the line :

ACVBA.ARX

this will tell autocad to load the VBA environment.

In vba editor with NEW , create

ACAD.DVB

go to the Visual Basic Editor

under THIS DRAWING you will see the file ACAD.dvb

put there the lines:


Sub ACADStartup()

Call AcadApplication.LoadDVB("fxBreakLine.dvb")

End Sub


At the toolbar use the command:

(command "vbarun" "fxBreakLine")

That will run your macro.

Every time autocad starts up it will load the program(s) mentioned under Sub
ACADStartup().
You only need to call the right macro.

This is how I do all my VBA macro's.

Lol.





"Dave F." wrote in message
news:5784157@discussion.autodesk.com...
Hi All (& Tony if you're around)

in the following Tony said "executes a macro
defined in the DVB file."

But for the life of me I can't get the routine to run.

http://www.caddzone.com/autovbaload.lsp

I've tried it out from a toolbar with:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

The command is created - if I type fxBreakLine at the command line it does
execute.

Any ideas how can I get it to work when AutoVBALoad is executed?

Cheers in advance.

Dave F.
Message 7 of 8
Anonymous
in reply to: Anonymous

I only make VBA macro's that I need very often, so wat's the point.
If I would use them ones a month, its not worth to make them .
And that few kb in memory is not the problem, there is enough available.


"Tony Tanzillo" wrote in message
news:5785012@discussion.autodesk.com...
Perhaps you should try to understand what the purpose
of 'autoloading' is. The purpose is to eliminate the need
to load a DVB file at startup, and only load it if/when you
actually need it.

AutoVBALoad is one way to achieve that, because it lets
you have many DVB files that are only loaded if they're
needed, but are never loaded otherwise.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"The Marker" wrote in message
news:5784834@discussion.autodesk.com...
Be sure to have a file called ACAD.RX in your search path.
That (text) file must have the line :

ACVBA.ARX

this will tell autocad to load the VBA environment.

In vba editor with NEW , create

ACAD.DVB

go to the Visual Basic Editor

under THIS DRAWING you will see the file ACAD.dvb

put there the lines:


Sub ACADStartup()

Call AcadApplication.LoadDVB("fxBreakLine.dvb")

End Sub


At the toolbar use the command:

(command "vbarun" "fxBreakLine")

That will run your macro.

Every time autocad starts up it will load the program(s) mentioned under Sub
ACADStartup().
You only need to call the right macro.

This is how I do all my VBA macro's.

Lol.





"Dave F." wrote in message
news:5784157@discussion.autodesk.com...
Hi All (& Tony if you're around)

in the following Tony said "executes a macro
defined in the DVB file."

But for the life of me I can't get the routine to run.

http://www.caddzone.com/autovbaload.lsp

I've tried it out from a toolbar with:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

The command is created - if I type fxBreakLine at the command line it does
execute.

Any ideas how can I get it to work when AutoVBALoad is executed?

Cheers in advance.

Dave F.
Message 8 of 8
Anonymous
in reply to: Anonymous

If you're a casual VBA user with only one or
two DVB files that don't take long to load at
startup, then what you do for yourself is fine,
but that isn't necessarily the best course for
others.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"The Marker" wrote in message news:5785361@discussion.autodesk.com...
I only make VBA macro's that I need very often, so wat's the point.
If I would use them ones a month, its not worth to make them .
And that few kb in memory is not the problem, there is enough available.


"Tony Tanzillo" wrote in message
news:5785012@discussion.autodesk.com...
Perhaps you should try to understand what the purpose
of 'autoloading' is. The purpose is to eliminate the need
to load a DVB file at startup, and only load it if/when you
actually need it.

AutoVBALoad is one way to achieve that, because it lets
you have many DVB files that are only loaded if they're
needed, but are never loaded otherwise.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"The Marker" wrote in message
news:5784834@discussion.autodesk.com...
Be sure to have a file called ACAD.RX in your search path.
That (text) file must have the line :

ACVBA.ARX

this will tell autocad to load the VBA environment.

In vba editor with NEW , create

ACAD.DVB

go to the Visual Basic Editor

under THIS DRAWING you will see the file ACAD.dvb

put there the lines:


Sub ACADStartup()

Call AcadApplication.LoadDVB("fxBreakLine.dvb")

End Sub


At the toolbar use the command:

(command "vbarun" "fxBreakLine")

That will run your macro.

Every time autocad starts up it will load the program(s) mentioned under Sub
ACADStartup().
You only need to call the right macro.

This is how I do all my VBA macro's.

Lol.





"Dave F." wrote in message
news:5784157@discussion.autodesk.com...
Hi All (& Tony if you're around)

in the following Tony said "executes a macro
defined in the DVB file."

But for the life of me I can't get the routine to run.

http://www.caddzone.com/autovbaload.lsp

I've tried it out from a toolbar with:
(AutoVBALoad "fxBreakLine" "fxBreakLine.dvb" nil)

The command is created - if I type fxBreakLine at the command line it does
execute.

Any ideas how can I get it to work when AutoVBALoad is executed?

Cheers in advance.

Dave F.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost