Ascii problem

Ascii problem

Anonymous
Not applicable
1,118 Views
6 Replies
Message 1 of 7

Ascii problem

Anonymous
Not applicable

Good evening everyone. 

I have a script file. Content is 

xdata last somename ST somecontent X 

 

the problem is it does not terminate the xdata command in the script file with X, but instead i have to press enter after the script file and X is added to xdata with somecontent. 

 

Can anyone tell me what Iam missing out?

 

thanks

0 Likes
Accepted solutions (3)
1,119 Views
6 Replies
Replies (6)
Message 2 of 7

TheCADnoob
Mentor
Mentor

 

You can try making sure that the file does not end on X and that it ends on a carriage return to the next line, or possibly by adding a space " " on the last line if you are wanting to repeat the command. 

CADnoob

EESignature

0 Likes
Message 3 of 7

Anonymous
Not applicable

The part somedata, autocad asks to enter text, unfortunately, space is treated as part of somedata instead of terminating the command

0 Likes
Message 4 of 7

TheCADnoob
Mentor
Mentor
Accepted solution

yea the space is supposed to run the command again. I type it wrong earlier. 

 

If you enter two carriage returns as depicted below it will finish the command. 

 

[script]

[carriage return]

[carriage return]

 

Notice the cursor indicating a carriage return under the command

CADnoob script file.GIF

 

 

This link may help

http://streamlined-design.blogspot.com/2011/11/invisible-problems-in-autocad-script.html

 

CADnoob

EESignature

Message 5 of 7

dbhunia
Advisor
Advisor
Accepted solution

Sorry i wrongly posted you @TheCADnoob, this is for @Anonymous...

 

Try like this in script file......

 

xdata last bob st 42
x

or

xdata
last
bob
st
42
x

 

Because I think you want to enter "ASCII string" as "42" and then want to exit by "X"......

 

If so then ........ After Entering  the option "ST" CAD will ask you to enter "Enter ASCII string:", so whatever you write (including space) after "ST" that will be treated as string until placed an "Enter" in script file......After that you can place "X" to "Exit" normally.....


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 6 of 7

Anonymous
Not applicable
Accepted solution

Thank you very much. Your suggestion was correct. 2 carriage return will terminate the command. But X will still be added as part of the xdata. After 42, 2 carriage return must be added since X must terminate the command. 

 

xdata last bob ST 42

<enter>

<enter>

 

that script is what I need. 

0 Likes
Message 7 of 7

Anonymous
Not applicable

Thank you for the info. I will use your first suggestion rather than the second because I will have a very long script.

0 Likes