• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

how to use a .vbs file

  • Thread starter Thread starter carry
  • Start date Start date

carry

Guest
Hi.
someone knows how to use a .vbs file inside autocad?
I better explain I have a .vbs file to read .mdb files but I don't understand how you can use it inside autocad,
I should be able to read the .mdb file, read the values and pass them to the lisp.
Thank you.
 
that I know the .vbs are visual basic scripts that are executed by the operating system. I don't know the connection with autocad how it can happen, but perhaps by posting a branch of the vbs code you can try to rebuild the operation.
 
hello and thanks for the answers,
if they work with the operating system, the autocad command to start an operating system program is:
command: shell
command os: test.vbs
I tried with the example code, created the test file.vbs
but it gives me error of syntax......
but the auto connection - os works.
Now I'm not in the office, maybe tomorrow I place the code I need.
Hi.

on error resume next
set objacad = getobject(, "autocad.application")
if err.number < > then errclear
msgbox "autocad is not currently running...!!"
on

if objacad.visible = true then
objacad.visible = false

objacad.visible = true
end if
end ifset objacad = nothing
 
on error resume next
set objacad = getobject(, "autocad.application")
if err.number <> 0 then err.clear
msgbox "autocad is not currently running...!!", vbexclamati
on
else
if objacad.visible = true then
objacad.visible = false
else
objacad.visible = true
end if
end ifset objacad = nothing
seems to be launched with a double click, while autocad is running.
seems to write about autocad environment variables.

What if you launch autocad and then double click on .vbs?

Make sure there are no antivirus or firewalls (including windows!) that can block the script.
 
Hi.
for general information on how to interact visual basic script and autocad.
I did some evidence, and I actually managed to get data to be imported in autocad like this:
turning the visual basic script file I wrote a text file,
with the lisp or with vba you read the text file with inside the data to be uploaded.
Hi.
 
I add
you create a button with command: shell "c:\....name visual file basic script "
you turn the script, you create a text file with the values generated by the script,
read values with vba or lisp.
Hi.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top