"/" in menu

"/" in menu

Anonymous
Not applicable
347 Views
8 Replies
Message 1 of 9

"/" in menu

Anonymous
Not applicable
I'm attempting to write a custom menu which
will open a particular drawing by selecting a menu
option. This requires a path to the directory in which
the drawing is located. The problem is that the / in the
path is interpreted as a pause for user input. Can anyone
help me?

Thanks
0 Likes
348 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Try using "\" instead. That should work. Ken.

John Bockleman wrote in message
news:7vt2bv$98u29@adesknews2.autodesk.com...
> I'm attempting to write a custom menu which
> will open a particular drawing by selecting a menu
> option. This requires a path to the directory in which
> the drawing is located. The problem is that the / in the
> path is interpreted as a pause for user input. Can anyone
> help me?
>
> Thanks
>
>
>
0 Likes
Message 3 of 9

Anonymous
Not applicable
Are you sure you are not confusing / with \
\ pauses for user input while / is ok for file paths.
To avoid the file dialogue box use FILEOPEN
rather than OPEN.
or maybe you are using long filenames and/or paths
which should be enclosed in double quotes.
e.g.
[Open This One]^C^CFILEOPEN "C:/ACAD DWGS/THIS ONE.DWG"
As a side comment it is usually better to avoid having hard-coded
file names in your menu file. Better to refer to a global lisp variable,
or a users# variable, or a CFG variable,or a dictionary record,
which can be set in YOURMENU.MNU file and accessed via
a simple lisp function.
Regards Ian

John Bockleman wrote in message <7vt2bv$98u29@adesknews2.autodesk.com>...
>I'm attempting to write a custom menu which
>will open a particular drawing by selecting a menu
>option. This requires a path to the directory in which
>the drawing is located. The problem is that the / in the
>path is interpreted as a pause for user input. Can anyone
>help me?
>
>Thanks
>
>
>
0 Likes
Message 4 of 9

Anonymous
Not applicable
Error in previous post.
YOURMENU.MNU file should read YOURMENU.MNL file.
Regards Ian

Ian Bryant wrote in message <7vuati$da53@adesknews2.autodesk.com>...
>Are you sure you are not confusing / with \
>\ pauses for user input while / is ok for file paths.
>To avoid the file dialogue box use FILEOPEN
>rather than OPEN.
>or maybe you are using long filenames and/or paths
>which should be enclosed in double quotes.
>e.g.
>[Open This One]^C^CFILEOPEN "C:/ACAD DWGS/THIS ONE.DWG"
>As a side comment it is usually better to avoid having hard-coded
>file names in your menu file. Better to refer to a global lisp variable,
>or a users# variable, or a CFG variable,or a dictionary record,
>which can be set in YOURMENU.MNU file and accessed via
>a simple lisp function.
>Regards Ian
0 Likes
Message 5 of 9

Anonymous
Not applicable
if you really want to hard code a path you could use STRCAT and (CHR 92)
... I think that's the ascii number for "\" .... like so: (strcat "c:"
(chr 92) "filename.ext")

John Bockleman wrote:

> I'm attempting to write a custom menu which
> will open a particular drawing by selecting a menu
> option. This requires a path to the directory in which
> the drawing is located. The problem is that the / in the
> path is interpreted as a pause for user input. Can anyone
> help me?
>
> Thanks

--
Later,
Josh
joshc@mindspring.com

"I'm a perfectionist...I'm just not very good at it."
0 Likes
Message 6 of 9

Anonymous
Not applicable
Or, possibly a \\ would work well as it is equal to a / in most paths.
--
Dave D
(remove '-' for Email)

Josh wrote in article
<3828D91C.48C2EC11@mindspring.com>...
> if you really want to hard code a path you could use STRCAT and (CHR 92)
> ... I think that's the ascii number for "\" .... like so: (strcat "c:"
> (chr 92) "filename.ext")
>
> John Bockleman wrote:
>
> > I'm attempting to write a custom menu which
> > will open a particular drawing by selecting a menu
> > option. This requires a path to the directory in which
> > the drawing is located. The problem is that the / in the
> > path is interpreted as a pause for user input. Can anyone
> > help me?
> >
> > Thanks
>
> --
> Later,
> Josh
> joshc@mindspring.com
>
> "I'm a perfectionist...I'm just not very good at it."
>
>
>
0 Likes
Message 7 of 9

Anonymous
Not applicable
Autolisp interprets both \ and // as /, and / as pause.

John Bockleman wrote in message <7vt2bv$98u29@adesknews2.autodesk.com>...
>I'm attempting to write a custom menu which
>will open a particular drawing by selecting a menu
>option. This requires a path to the directory in which
>the drawing is located. The problem is that the / in the
>path is interpreted as a pause for user input. Can anyone
>help me?
>
>Thanks
>
>
>
0 Likes
Message 8 of 9

Anonymous
Not applicable
The "\" (backslash) is interpreted as a in a menu macro. Replace the
"\" (Backslashes) with "/" (Forward Slashes) in the path and it should be
fine. (I think that's what you meant below.)

NOTE: A menu macro will not interpret "\\" as a single backslash like in
AutoLISP. It will just issue Two instructions.

--
Phillip Kenewell
CAD Systems Technician
Air Gage Company
pkenewell@airgage.com
===================
> Not < a Member of the AutoDESK
Discussion Forum Moderator Program

John Bockleman wrote in message
news:7vt2bv$98u29@adesknews2.autodesk.com...
> I'm attempting to write a custom menu which
> will open a particular drawing by selecting a menu
> option. This requires a path to the directory in which
> the drawing is located. The problem is that the / in the
> path is interpreted as a pause for user input. Can anyone
> help me?
>
> Thanks
>
>
>
0 Likes
Message 9 of 9

Anonymous
Not applicable
> Autolisp interprets both \ and // as /, and / as pause.

Huh?

Then I must be using a 'special' version of AutoLISP.

(load "c:\\acad\\r14\\lmsfiles\\acad") and
(load "c:/acad/r14/lmsfiles/acad")

both work for me in a routine, and

(load "c:/acad/r14/lmsfiles/acad")

even works in a menu.

I think John's problem is with the command "open" itself.
--
Dave D
(remove '-' for Email)

Art Mahanna wrote in article
<80ccrd$cou31@adesknews2.autodesk.com>...
> Autolisp interprets both \ and // as /, and / as pause.
>
> John Bockleman wrote in message <7vt2bv$98u29@adesknews2.autodesk.com>...
> >I'm attempting to write a custom menu which
> >will open a particular drawing by selecting a menu
> >option. This requires a path to the directory in which
> >the drawing is located. The problem is that the / in the
> >path is interpreted as a pause for user input. Can anyone
> >help me?
> >
> >Thanks
> >
> >
> >
>
>
>
0 Likes