Jump to content

LISP Folder Directory and Hyperlink


Ohnoto

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:

/Project/03_Final/AwesomeCAD.dwg

 

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

/Project/02_Photos/AwesomeImage.jpg

 

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?

 

Thanks!

 

 

Update:

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
Link to comment
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.

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