Jump to content

LISP Folder Directory and Hyperlink

Recommended Posts


Hello everyone,


I have some LISP code to hyperlink blocks to a file. However, based on new folder structure my company has started using, I am trying to adjust it.


We have a folder for drawings:



And within the cad drawing, I am wanting to hyperlink to photos at:



The way it currently works, the dwg file needs to be at the same location as images.


(setq URL (strcat "\\02_Photos\\" pID "-" sID "_" num0 ".jpg"))

How would I modify this to hyperlink to another folder in the same project location?






I got it to work using:


(setq URL (strcat (getvar "dwgprefix") "..\\02_Photos\\" pID "-" sID "_" num0 ".jpg"))


However, I need to path to be relative.

Edited by Ohnoto

Share this post

Link to post
Share on other sites

I do not really understand the request nor the issues you have. Maybe post the code so it may be more clear. Thanks!

Share this post

Link to post
Share on other sites

I can't post the full code. It was not written by me, but a co-worker, for company purposes, and is pretty long. I was going through it to tweak a bit to what I needed it to do.


Our folder structure here is:


Project Name


  • 01_WIP
  • 02_Photos
  • 03_Final
  • 04_Sent to Client
  • 05_3D Files


When we do send a project to a client, we send the 02_Photos folder and 03_Final folder.


Within our drawing, we have a block that represents where photos were taken from. Our owner is wanting to have these hyperlinked when sending to a client.


When I was stating relative before, I was in the mindset of relative path, like xrefs, where xrefs will stay attached across folders, as long as the folder structure is intact.


We do have it LISP to work, but only when the photos folder is in the same folder as the drawing. I was looking to see if there was a way to keep them connected across folders.


From what I have been researching, it may not be possible dealing with hyperlinks, but I'm hoping someone can prove me wrong.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now