Jump to content

How to use a relative path in a Macro to run a .lsp file?


Alaskachick

Recommended Posts

I am trying to write a macro for a new command located on a custom toolbar button to call up a lisp located in a folder on a network. I want the path to be relative so different users can all access the same file. I have added the search path to my "support file search path" folder under options.

 

Here is the macro I have so far:

 

^C^C(if c:CE1117 nil (load (strcat /autodesk/utilites/lisp/1pp "CE1117")));CE1117

 

I don't know how much of the path to the network location I need to include. I just did the last three folders. Also, I have no idea how many /'s to add before the folder name. I have tried various quantities and nothing is working. This is what I get when I hit the button to call the lisp:

 

Command: (if c:CE1117 nil (load (strcat /autodesk/utilites/lisp/1pp "CE1117")))

; error: bad argument type: stringp nil

Command: CE1117 Unknown command "CE1117". Press F1 for help.

 

It is possible to do this right?

Link to comment
Share on other sites

Well, I think I figured it out. I had too much info in my macro. If the support path is added that leads to the folder on the network then this macro works great:

 

^C^C(if c:CE1117 nil (load (strcat "CE1117")));CE1117

Link to comment
Share on other sites

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