Jump to content

Error with isp that opens explorer window.


Recommended Posts

Posted

Hi all, I've been using AutoCAD for a while now but am only just beginning to learn how to use AutoLISP.

 

I have created a lisp that opens an explorer window showing the location of the currently open file:

 

(command "start" (strcat "explorer " (getvar "dwgprefix")))

 

My problem is that when I open certain files I receive an error dialog stating that:

"The path 'file path' does not exist or is not a directory."

 

This only occurs when the file path is quite long (over approx 40 characters).

Is there a way that I can fix this?

 

Thanks in advance

Posted

Is now really a good time to initiate your LISP skillset?

Posted

Hi toffeemilkshake,

 

Welcome to the forum

 

(command "start" (strcat "explorer " (getvar "dwgprefix")))

 

Seems to work fine. I just tested it with a path 142 characters long with no errors produced. I actually use a similar code myself which achieves the same thing

 

(startapp "explorer" (getvar "dwgprefix"))

 

The only time I come across erroe message

 

"The path 'file path' does not exist or is not a directory."

 

is when the directory does not exist

 

Are there any other parts to your routine?

 

Regards,

 

-Jammie

Posted

Hi Jammie,

 

Thanks for the response.

 

There are no other parts within my routine so I have no idea what's wrong with it.

 

However I did try using your code and everything seems to work fine that way.

 

Regards,

 

tm

Posted
Hi Jammie,

 

Thanks for the response.

 

There are no other parts within my routine so I have no idea what's wrong with it.

 

However I did try using your code and everything seems to work fine that way.

 

Regards,

 

tm

 

Your welcome toffeemilkshake,

 

I am not sure why your original code caused an error but glad I could be of some help

 

Regards,

 

-Jammie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...