Jump to content

Recommended Posts

Posted

Hi,

 

I'm trying to add a new toolbar button.

 

I have this X.lsp at "\\files\cad\AutoCAD\LISP\X.lsp"

 

Found this macro by surfing around (among others):

^C^C^Pcsaa;

 

I want to know how can a code find my lsp, load it and the rund it.

 

 

Appriciate any help!

Posted (edited)

Presuming the name of command defined inside X.LSP is XCommand:

^C^C^P(progn (load "[color=red][b]\\[/b][/color]\\files\\cad\\AutoCAD\\LISP\\X.lsp" (alert "Unable to find X.LSP")) ([color=blue]c:XCommand[/color]) (princ)) ^P

Please note the doubled backslashes.

Edited by MSasu
Didn't noticed that path is a server one
Posted

If the function you want to run is also named "X", you could do it like this:

 

(if (not c:x)(load "\\\\server\\share\\cad\\AutoCAD\\LISP\\X.lsp"));x;

Posted

Hi and thanks for your reply.

 

None of the codes above work for me :(

 

See the attached pictures.

1.PNG

2.PNG

Posted

If the function is named x write in the button macro:

 

 

^C^C(if (not x) (load "//pcname/partition/files/cad/AutoCAD/x")) x

Posted

Like this:

 

^C^C(if (not x) (load "\\files\cad\AutoCAD\LISP\x.lsp")) x

 

 

If the function is named x write in the button macro:

 

 

^C^C(if (not x) (load "//pcname/partition/files/cad/AutoCAD/x")) x

Posted

I see :oops:...It does work now. but only on my PC. How can i distribute at my office with my other colleagues? Is there a way to export this toolbar button?

 

I seem to be two different things

 

^C^C(if (not x) (load "\\files\cad\AutoCAD\LISP\x.lsp")) x

^C^C(if (not x) (load "//files/cad/AutoCAD/LISP/x")) x

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...