Visual Basic Customization

Reply
*Stanich, Rick
Message 1 of 9 (39 Views)

R14 and VB5 (not VBA)

39 Views, 8 Replies
12-08-1999 04:39 AM
I am using VB5 and trying to set a variable to the following:
(Batchscr_setscript "c:/myfolder/myscript.scr")
This is what I have right now:
myvar = "(" & "Batchscr_setscript" & " " & "c:/myfolder/myscript.scr" & """
& ")"
when this is sent to Acad(R14) it breaks it up into two (2) lines and
removes the Brackets. see below

"Command: Batchscr_setscript"
Unknown Command
"Command: c:/myfolder/myscript.scr"
Unknown Command

What am I doing wrong? (besides programming, LOL)

--
Boycott goods and services
Solicited with junk Email.

Thank You

Rick Stanich
System Administrator
Stanich Design & Associates Inc. (S.D.A.I.)
38025 Second St. Suite 103
Willoughby, Ohio. 44094
440.951.5303 voice 440.951.4936 fax
www.stanichdesign.com

"FAILURE IS NOT AN OPTION.
It comes bundled with the software"

Any use of the names/addresses within this WebPages/E-mail/Fax
re: unsolicited/commercial WebPages/E-mail/Fax, is strictly forbidden
except for its intended use, without written approval
from its originator. Fee for receipt of electronically
delivered unsolicited commercial WebPages/E-mail/Fax,
including WebPages/E-mail/Fax that advertises a commercial site,
is US$500.00 MINIMUM per message.
In addition,
Violators will be assessed a US$500.00 MINIMUM fee for each occurrence
as a proofreading fee in accordance with US Code Title 47 section
227(a,2,B),section 227(b,1,C), and section 227(b,3,C).

Having this notice accessible within this WebPages/E-mail/Fax
constitutes fair prior legal notice.

http://www.law.cornell.edu/uscode/47/227.html
*Stanich, Rick
Message 2 of 9 (39 Views)

Re: R14 and VB5 (not VBA)

12-08-1999 05:12 AM in reply to: *Stanich, Rick
Andy-
this is the result:

Command: []Batchscr_setscript Unknown command "[]BATCHSCR_SETSCRIPT". Press
F1
for help.

Command: "c:/myfolder/myscript.scr"[]
Unknown command ""C:/MYFOLDER/MYSCRIPT.SCR"[]". Press F1 for help.
*Stanich, Rick
Message 3 of 9 (39 Views)

Re: R14 and VB5 (not VBA)

12-08-1999 05:46 AM in reply to: *Stanich, Rick
I am aware that AutoCAD interprets the space literally (no pun intended) but
I also enclosed the text in "()" which are not being sent for some reason.
(Batchscr_setscript "c:/myfolder/myscript.scr") This is the text I want to
send, If I type this within AutoCAD then it works as written (notice the
space between batchscr_setscript and "c:/myfolder/myscript.scr") and the
quotes containing "c:/myfolder/myscript.scr"..
If I just wanted to send "Batchscr_setscript "c:/myfolder/myscript.scr""
then of course it will split this into two (2) separate commands.

Thanks for your input tho...

Rick
*Stanich, Rick
Message 4 of 9 (39 Views)

Re: R14 and VB5 (not VBA)

12-08-1999 06:38 AM in reply to: *Stanich, Rick
Result:
Command: Batchscr_setscript Unknown command "BATCHSCR_SETSCRIPT". Press F1
for
help.

Command: c:/myfolder/myscript.scr
Unknown command "C:/MYFOLDER/MYSCRIPT.SCR". Press F1 for help.

No Brackets "()"?

This is my code in VB5 project..
Myvar = Chr(40) & "Batchscr_setscript" & Chr(32) &
"c:/myfolder/myscript.scr" & Chr(41)
CadCommand$ = myvar & "~" & "batchscr~"
The above should produce the following:
(batchscr_setscript "c:/work/myscript.scr") 'first command to set up next
command.
batchscr 'ARX file to run, preloaded.

Hmm. I don't think I mentioned that I am using "SendKeys" Did I?
*Cottrell, Andy
Message 5 of 9 (39 Views)

Re: R14 and VB5 (not VBA)

12-08-1999 10:00 AM in reply to: *Stanich, Rick
Rick,
Try the following
myvar = "[(]Batchscr_setscript ""c:/myfolder/myscript.scr""[)]"

--
Andy Cottrell
Applications Engineer
ExcelTech Computer Services
E-Mail: acottrell@exceltech.net

Rick Stanich wrote in message
news:82m51l$ibp21@adesknews2.autodesk.com...
> I am using VB5 and trying to set a variable to the following:
> (Batchscr_setscript "c:/myfolder/myscript.scr")
> This is what I have right now:
> myvar = "(" & "Batchscr_setscript" & " " & "c:/myfolder/myscript.scr" &
"""
> & ")"
> when this is sent to Acad(R14) it breaks it up into two (2) lines and
> removes the Brackets. see below
>
> "Command: Batchscr_setscript"
> Unknown Command
> "Command: c:/myfolder/myscript.scr"
> Unknown Command
>
> What am I doing wrong? (besides programming, LOL)
>
> --
> Boycott goods and services
> Solicited with junk Email.
>
> Thank You
>
> Rick Stanich
> System Administrator
> Stanich Design & Associates Inc. (S.D.A.I.)
> 38025 Second St. Suite 103
> Willoughby, Ohio. 44094
> 440.951.5303 voice 440.951.4936 fax
> www.stanichdesign.com
>
> "FAILURE IS NOT AN OPTION.
> It comes bundled with the software"
>
> Any use of the names/addresses within this WebPages/E-mail/Fax
> re: unsolicited/commercial WebPages/E-mail/Fax, is strictly forbidden
> except for its intended use, without written approval
> from its originator. Fee for receipt of electronically
> delivered unsolicited commercial WebPages/E-mail/Fax,
> including WebPages/E-mail/Fax that advertises a commercial site,
> is US$500.00 MINIMUM per message.
> In addition,
> Violators will be assessed a US$500.00 MINIMUM fee for each occurrence
> as a proofreading fee in accordance with US Code Title 47 section
> 227(a,2,B),section 227(b,1,C), and section 227(b,3,C).
>
> Having this notice accessible within this WebPages/E-mail/Fax
> constitutes fair prior legal notice.
>
> http://www.law.cornell.edu/uscode/47/227.html
>
>
>
>
*Oquendo, Frank
Message 6 of 9 (39 Views)

Re: R14 and VB5 (not VBA)

12-08-1999 10:26 AM in reply to: *Stanich, Rick
Replace the space with Chr(32). AutoCAD interprets the space literally,
thereby converting it to a carriage return.

"Rick Stanich" wrote in message
news:82m51l$ibp21@adesknews2.autodesk.com...
> I am using VB5 and trying to set a variable to the following:
> (Batchscr_setscript "c:/myfolder/myscript.scr")
> This is what I have right now:
> myvar = "(" & "Batchscr_setscript" & " " & "c:/myfolder/myscript.scr" &
"""
> & ")"
> when this is sent to Acad(R14) it breaks it up into two (2) lines and
> removes the Brackets. see below
>
> "Command: Batchscr_setscript"
> Unknown Command
> "Command: c:/myfolder/myscript.scr"
> Unknown Command
>
> What am I doing wrong? (besides programming, LOL)
>
> --
> Boycott goods and services
> Solicited with junk Email.
>
> Thank You
>
> Rick Stanich
> System Administrator
> Stanich Design & Associates Inc. (S.D.A.I.)
> 38025 Second St. Suite 103
> Willoughby, Ohio. 44094
> 440.951.5303 voice 440.951.4936 fax
> www.stanichdesign.com
>
> "FAILURE IS NOT AN OPTION.
> It comes bundled with the software"
>
> Any use of the names/addresses within this WebPages/E-mail/Fax
> re: unsolicited/commercial WebPages/E-mail/Fax, is strictly forbidden
> except for its intended use, without written approval
> from its originator. Fee for receipt of electronically
> delivered unsolicited commercial WebPages/E-mail/Fax,
> including WebPages/E-mail/Fax that advertises a commercial site,
> is US$500.00 MINIMUM per message.
> In addition,
> Violators will be assessed a US$500.00 MINIMUM fee for each occurrence
> as a proofreading fee in accordance with US Code Title 47 section
> 227(a,2,B),section 227(b,1,C), and section 227(b,3,C).
>
> Having this notice accessible within this WebPages/E-mail/Fax
> constitutes fair prior legal notice.
>
> http://www.law.cornell.edu/uscode/47/227.html
>
>
>
>
*Oquendo, Frank
Message 7 of 9 (39 Views)

Re:

12-08-1999 11:13 AM in reply to: *Stanich, Rick
Try replacing the parens with the appropriate Chr code as well.

"Rick Stanich" wrote in message
news:82m8vn$k8u7@adesknews2.autodesk.com...
> I am aware that AutoCAD interprets the space literally (no pun intended)
but
> I also enclosed the text in "()" which are not being sent for some reason.
> (Batchscr_setscript "c:/myfolder/myscript.scr") This is the text I want to
> send, If I type this within AutoCAD then it works as written (notice the
> space between batchscr_setscript and "c:/myfolder/myscript.scr") and the
> quotes containing "c:/myfolder/myscript.scr"..
> If I just wanted to send "Batchscr_setscript "c:/myfolder/myscript.scr""
> then of course it will split this into two (2) separate commands.
>
> Thanks for your input tho...
>
> Rick
>
>
*Stanich, Rick
Message 8 of 9 (39 Views)

Re: R14 and VB5 (not VBA)

12-09-1999 02:53 AM in reply to: *Stanich, Rick
Your right. I am just to new to VB5 to no when I am wasting my time..
Although I did resolve the problem by loading a script file with sendkeys
with modified code from Randall Rath. The script file then passes the line
with "()" intact.

Thanks for all your help, it is greatly appreciated and taught me a lesson.

Rick Stanich
*Oquendo, Frank
Message 9 of 9 (39 Views)

Re:

12-09-1999 06:39 AM in reply to: *Stanich, Rick
Go to the Customer Files NG and look for AcadUnSupp.arx. It has a method to
send string to the command line that is a lot less flakey than SendKeys.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community