.SCR to Import and Restore Layer State

.SCR to Import and Restore Layer State

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

.SCR to Import and Restore Layer State

Anonymous
Not applicable

Hi,

 

I am trying to write a script to import and restore a .las file.

 

-Layer
A
I
C:\Users\Me\Example\Example.las
R
Example.las
(Space/Enter)
(Space/Enter)
(Space/Enter)
(Space/Enter)

 This works when I do it manually, but when running the script it gets an error after executing "I".

It defaults to the file path of the file I'm trying to run the script on rather than the file path in the script. There is not an extra space after "I".

 

Does anyone have an idea of what I'm doing wrong? Also, I am using AutoCAD LT, so I can't switch to a LISP solution.

 

Thanks

Ryan

Accepted solutions (1)
1,690 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

I don't use Scripts much, but as a guess:

 

Help doesn't say anything about it, but could this be as in AutoLisp, that filepath separators need to be either double  backslashes or single forward  slashes?  That's needed in AutoLisp because a single backslash is a marker for a following control character, but I'm not sure about Scripts.

Kent Cooper, AIA
0 Likes
Message 3 of 4

Anonymous
Not applicable
Accepted solution

There was a space in the name of a folder in the file path.

Enclosing the entire filepath in quotes solved the issue.

 

Ryan

0 Likes
Message 4 of 4

Anonymous
Not applicable

It was because the real filepath I was using had a space in one of the folder names. I closed that entire line in quotes, solving my issue. Thanks for replying though!

0 Likes