Newbie question VBALoad
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Newbie question VBALoad

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
BillZ
Guest





Posted: Tue Mar 22, 2005 7:18 pm    Post subject: Newbie question VBALoad Reply with quote

R2005 VBA

Hello all!

I'm beginning to use the built in VBA in AutoCAD.
I had followed a tutorial and created a project.
After I opened AutoCAD, I typed in VBAIDE and the visual basic console opened. Then at the command prompt, I typed in (vl-vbaload "g:/vba/BZProjectTest.dvb") and my project loaded into the VBA console and was now visible in the console.
Next I typed in (vl-vbarun "g:/vba/BZProjectTest.dvb!testmacro") and my dialog became visible on the AutoCAD screen and everything worked as expected. But when I look at the VBA console, I now show two BZProject1(g:\vba\bzprojecttest.dvb) in the project window.
What am I doing wrong? And what do Ido to get rid of one of the sessions of BZProject1(g:\vba\bzprojecttest.dvb)?
This happended yeaterday too when I did a vbaload 2 times in a row.

Any help would be appreciated.

TIA

Bill

Back to top
James Allen
Guest





Posted: Tue Mar 22, 2005 11:47 pm    Post subject: Re: Newbie question VBALoad Reply with quote

Hi Bill,

You must mean you typed in VLIDE and the visual lisp console opened... I've
been using the following lisp to -load and- run my vba macros.
(vla-RunMacro (vlax-get (vlax-get-Acad-Object) 'ActiveDocument)
"<projectname>.dvb!<modulename>.<macroname>")
If I remember right, vl-vbarun will -load and- run your macro, but I didn't
think it would load it again if it was already loaded.
<not much farther along myself>
To get rid of one, use VBAMAN and unload one.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"BillZ" <nospam@address.withheld> wrote in message
news:7333929.1111501117883.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
R2005 VBA

Hello all!

I'm beginning to use the built in VBA in AutoCAD.
I had followed a tutorial and created a project.
After I opened AutoCAD, I typed in VBAIDE and the visual basic console
opened. Then at the command prompt, I typed in (vl-vbaload

"g:/vba/BZProjectTest.dvb") and my project loaded into the VBA console and
was now visible in the console.
Quote:
Next I typed in (vl-vbarun "g:/vba/BZProjectTest.dvb!testmacro") and my
dialog became visible on the AutoCAD screen and everything worked as

expected. But when I look at the VBA console, I now show two
BZProject1(g:\vba\bzprojecttest.dvb) in the project window.
Quote:
What am I doing wrong? And what do Ido to get rid of one of the sessions
of BZProject1(g:\vba\bzprojecttest.dvb)?
This happended yeaterday too when I did a vbaload 2 times in a row.

Any help would be appreciated.

TIA

Bill
Back to top
Oberer
Guest





Posted: Wed Mar 23, 2005 1:57 am    Post subject: Re: Newbie question VBALoad Reply with quote

I tried this syntax and it seems to work.
(vl-vbarun "G:/WARE/vb/HatchUpdate.dvb!Fix_Hatch")

(example)
'FIX HATCH DISPLAYPROBLEMS WITH GRAVEL & CONCRETE
(defun c:FixHatch ()
(vl-vbarun "G:/WARE/vb/HatchUpdate.dvb!Fix_Hatch")
)

Back to top
Paul Richardson
Guest





Posted: Wed Mar 23, 2005 2:15 am    Post subject: Re: Newbie question VBALoad Reply with quote

Quote:
You must mean you typed in VLIDE and the visual lisp console opened...

Why? He said he was using VBA. Did I miss something?
"James Allen" <JamesA~AA~mwengrs~DD~com> wrote in message
news:42406853$1_2@newsprd01...
Quote:
Hi Bill,

You must mean you typed in VLIDE and the visual lisp console opened...
I've
been using the following lisp to -load and- run my vba macros.
(vla-RunMacro (vlax-get (vlax-get-Acad-Object) 'ActiveDocument)
"<projectname>.dvb!<modulename>.<macroname>")
If I remember right, vl-vbarun will -load and- run your macro, but I
didn't
think it would load it again if it was already loaded.
not much farther along myself
To get rid of one, use VBAMAN and unload one.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"BillZ" <nospam@address.withheld> wrote in message
news:7333929.1111501117883.JavaMail.jive@jiveforum2.autodesk.com...
R2005 VBA

Hello all!

I'm beginning to use the built in VBA in AutoCAD.
I had followed a tutorial and created a project.
After I opened AutoCAD, I typed in VBAIDE and the visual basic console
opened. Then at the command prompt, I typed in (vl-vbaload
"g:/vba/BZProjectTest.dvb") and my project loaded into the VBA console and
was now visible in the console.
Next I typed in (vl-vbarun "g:/vba/BZProjectTest.dvb!testmacro") and my
dialog became visible on the AutoCAD screen and everything worked as
expected. But when I look at the VBA console, I now show two
BZProject1(g:\vba\bzprojecttest.dvb) in the project window.
What am I doing wrong? And what do Ido to get rid of one of the sessions
of BZProject1(g:\vba\bzprojecttest.dvb)?
This happended yeaterday too when I did a vbaload 2 times in a row.

Any help would be appreciated.

TIA

Bill

Back to top
James Allen
Guest





Posted: Wed Mar 23, 2005 4:01 am    Post subject: Re: Newbie question VBALoad Reply with quote

Oops! <"BillZ" wrote ... at the command prompt ...> I missed that part.
Went straight from the visual basic console to typing in lisp code and it
didn't make much sense. So I interpreted that he was trying out his
vba-loading lisp code on the fly in vlide. But he was trying it right at
the command prompt, just like he said. Sorry Bill. Thanks Paul.

James


"Paul Richardson" <prichardson@adelphia.net> wrote in message
news:42408aee_1@newsprd01...
Quote:
You must mean you typed in VLIDE and the visual lisp console opened...

Why? He said he was using VBA. Did I miss something?
"James Allen" <JamesA~AA~mwengrs~DD~com> wrote in message
news:42406853$1_2@newsprd01...
Hi Bill,

You must mean you typed in VLIDE and the visual lisp console opened...
I've
been using the following lisp to -load and- run my vba macros.
(vla-RunMacro (vlax-get (vlax-get-Acad-Object) 'ActiveDocument)
"<projectname>.dvb!<modulename>.<macroname>")
If I remember right, vl-vbarun will -load and- run your macro, but I
didn't
think it would load it again if it was already loaded.
not much farther along myself
To get rid of one, use VBAMAN and unload one.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"BillZ" <nospam@address.withheld> wrote in message
news:7333929.1111501117883.JavaMail.jive@jiveforum2.autodesk.com...
R2005 VBA

Hello all!

I'm beginning to use the built in VBA in AutoCAD.
I had followed a tutorial and created a project.
After I opened AutoCAD, I typed in VBAIDE and the visual basic console
opened. Then at the command prompt, I typed in (vl-vbaload
"g:/vba/BZProjectTest.dvb") and my project loaded into the VBA console
and
was now visible in the console.
Next I typed in (vl-vbarun "g:/vba/BZProjectTest.dvb!testmacro") and my
dialog became visible on the AutoCAD screen and everything worked as
expected. But when I look at the VBA console, I now show two
BZProject1(g:\vba\bzprojecttest.dvb) in the project window.
What am I doing wrong? And what do Ido to get rid of one of the
sessions
of BZProject1(g:\vba\bzprojecttest.dvb)?
This happended yeaterday too when I did a vbaload 2 times in a row.

Any help would be appreciated.

TIA

Bill



Back to top
Paul Richardson
Guest





Posted: Wed Mar 23, 2005 4:05 am    Post subject: Re: Newbie question VBALoad Reply with quote

Quote:
Oops!
I've been there many times...;-)

"James Allen" <JamesA~AA~mwengrs~DD~com> wrote in message
news:4240a3df$1_1@newsprd01...
Quote:
Oops! <"BillZ" wrote ... at the command prompt ...> I missed that part.
Went straight from the visual basic console to typing in lisp code and it
didn't make much sense. So I interpreted that he was trying out his
vba-loading lisp code on the fly in vlide. But he was trying it right at
the command prompt, just like he said. Sorry Bill. Thanks Paul.

James


"Paul Richardson" <prichardson@adelphia.net> wrote in message
news:42408aee_1@newsprd01...
You must mean you typed in VLIDE and the visual lisp console opened...

Why? He said he was using VBA. Did I miss something?
"James Allen" <JamesA~AA~mwengrs~DD~com> wrote in message
news:42406853$1_2@newsprd01...
Hi Bill,

You must mean you typed in VLIDE and the visual lisp console opened...
I've
been using the following lisp to -load and- run my vba macros.
(vla-RunMacro (vlax-get (vlax-get-Acad-Object) 'ActiveDocument)
"<projectname>.dvb!<modulename>.<macroname>")
If I remember right, vl-vbarun will -load and- run your macro, but I
didn't
think it would load it again if it was already loaded.
not much farther along myself
To get rid of one, use VBAMAN and unload one.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"BillZ" <nospam@address.withheld> wrote in message
news:7333929.1111501117883.JavaMail.jive@jiveforum2.autodesk.com...
R2005 VBA

Hello all!

I'm beginning to use the built in VBA in AutoCAD.
I had followed a tutorial and created a project.
After I opened AutoCAD, I typed in VBAIDE and the visual basic console
opened. Then at the command prompt, I typed in (vl-vbaload
"g:/vba/BZProjectTest.dvb") and my project loaded into the VBA console
and
was now visible in the console.
Next I typed in (vl-vbarun "g:/vba/BZProjectTest.dvb!testmacro") and
my
dialog became visible on the AutoCAD screen and everything worked as
expected. But when I look at the VBA console, I now show two
BZProject1(g:\vba\bzprojecttest.dvb) in the project window.
What am I doing wrong? And what do Ido to get rid of one of the
sessions
of BZProject1(g:\vba\bzprojecttest.dvb)?
This happended yeaterday too when I did a vbaload 2 times in a row.

Any help would be appreciated.

TIA

Bill





Back to top
James Allen
Guest





Posted: Wed Mar 23, 2005 8:13 am    Post subject: Re: Newbie question VBALoad Reply with quote

Bill, it looks like both vl-vbaload and vl-vbarun can load the same project
that is already loaded. I haven't *noticed* such issues with the variation
I posted earlier, but haven't checked for them either. You probably already
know this, but if your code shows up when you use vbaide, then it is already
loaded in the AutoCAD session. For working code, I think its probably best
to always let one of the runmacro functions -load and- run your macros.
--
James Allen, EIT
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"James Allen" <JamesA~AA~mwengrs~DD~com> wrote in message
news:4240a3df$1_1@newsprd01...
Quote:
Oops! <"BillZ" wrote ... at the command prompt ...> I missed that part.
Went straight from the visual basic console to typing in lisp code and it
didn't make much sense. So I interpreted that he was trying out his
vba-loading lisp code on the fly in vlide. But he was trying it right at
the command prompt, just like he said. Sorry Bill. Thanks Paul.

James
Back to top
BillZ
Guest





Posted: Wed Mar 23, 2005 4:54 pm    Post subject: Re: Newbie question VBALoad Reply with quote

Hi JAmes,

Quote:
You must mean you typed in VLIDE and the visual lisp console opened..

No I actually meant:
"I typed in VBAIDE and the visual basic console opened."

But anyway, thanks for the tip,I never thought about VBAMAN.

Bill
Back to top
BillZ
Guest





Posted: Wed Mar 23, 2005 4:57 pm    Post subject: Re: Newbie question VBALoad Reply with quote

No problem.

But I should've read all the posts before responding.

:^)

Bill
Back to top
BillZ
Guest





Posted: Wed Mar 23, 2005 5:08 pm    Post subject: Re: Newbie question VBALoad Reply with quote

Quote:
Bill, it looks like both vl-vbaload and vl-vbarun can load the same project
that is already loaded. I haven't *noticed* such issues with the variation

I posted earlier, but haven't checked for them either. You probably already
know this, but if your code shows up when you use vbaide, then it is already
loaded in the AutoCAD session. For working code, I think its probably best
to always let one of the runmacro functions -load and- run your macros.
<<<

It's kinda weird,

I did the same thing this morning (just testing).
The one I loaded using:

(vl-vbaload "g:/vba/BZProjectTest.dvb")

Showed up as: BZProject1 (g:\vba\BZProjectTest.dvb)

and the one that loaded when I used.

(vl-vbarun "g:/vba/BZProjectTest.dvb!testmacro")

Showed up as: BZProject1 (G:\vba\BZProjectTest.dvb)

Guess i'll just stay away from the vbaload function. :-)

Thanks


Bill
Back to top
BillZ
Guest





Posted: Wed Mar 23, 2005 5:10 pm    Post subject: Re: Newbie question VBALoad Reply with quote

Quote:
(example)
'FIX HATCH DISPLAYPROBLEMS WITH GRAVEL & CONCRETE

(defun c:FixHatch ()
(vl-vbarun "G:/WARE/vb/HatchUpdate.dvb!Fix_Hatch")
)<<<

Ah,

The lights keep coming on...

Thanks

Bill
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
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 vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB