Make a .dvb-file - making the VBA code working

Make a .dvb-file - making the VBA code working

Anonymous
Not applicable
1,924 Views
3 Replies
Message 1 of 4

Make a .dvb-file - making the VBA code working

Anonymous
Not applicable
Hi!

Can someone help me making the VBA-code I wrote work in Autocad? I don't know how to make a (or save the code as) .dvb-file. I figured out that I need a dvb-file to run the VBA code with Lisp... Or am I wrong?

Please help me!

Brigitte
0 Likes
1,925 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi Brigitte,

As far as I'm aware the only way to create/edit a DVB file is with the
VBAIDE in AutoCAD.

Type VBAIDE at the AutoCAD command line to enter the Editor.

--

Laurie Comerford
CADApps
www.cadapps.com.au

wrote in message news:5226858@discussion.autodesk.com...
Hi!

Can someone help me making the VBA-code I wrote work in Autocad? I don't
know how to make a (or save the code as) .dvb-file. I figured out that I
need a dvb-file to run the VBA code with Lisp... Or am I wrong?

Please help me!

Brigitte
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hi Laurie,

I've a DVB file now! Thnx!

I use this code in lisp to run the VBA called "LAS"

(defun c:LAS ( / filepath)
(if (setq filepath (findfile "LAS.dvb")) (progn
(vl-vbaload filepath)
(vl-vbarun "LAS")
)(progn
(princ "\nUnable to find VBA project file: LAS.dvb")
))
(princ)
)

(princ "\nLAS loaded. Type in LAS to run.")
(princ)

Can you tell me what I am doing wrong?

Brigitte
0 Likes
Message 4 of 4

Anonymous
Not applicable
Hi,

I don't know the name of the sub you have defined inside the DVB file so
can't give a complete anwer, but it will be something like:


(defun c:LAS ( / filepath)
(if (findfile "LAS.dvb")
(vl-vbarun "LAS.DVB!SUBNAME")
(princ "\nUnable to find VBA project file: LAS.dvb")
(princ)
)


You should search this NG for posts on running VBA from lisp. This type of
code is published regularly - often with discussion.


--

Laurie Comerford
CADApps
www.cadapps.com.au
wrote in message news:5226886@discussion.autodesk.com...
Hi Laurie,

I've a DVB file now! Thnx!

I use this code in lisp to run the VBA called "LAS"

(defun c:LAS ( / filepath)
(if (setq filepath (findfile "LAS.dvb")) (progn
(vl-vbaload filepath)
(vl-vbarun "LAS")
)(progn
(princ "\nUnable to find VBA project file: LAS.dvb")
))
(princ)
)

(princ "\nLAS loaded. Type in LAS to run.")
(princ)

Can you tell me what I am doing wrong?

Brigitte
0 Likes