Get the entity name (.tif)

Get the entity name (.tif)

mbest
Enthusiast Enthusiast
367 Views
2 Replies
Message 1 of 3

Get the entity name (.tif)

mbest
Enthusiast
Enthusiast

Hi all!

 

I'm inserting a scanned .tiff into a drawing.  I want to get the tiff name and save the drawing to that name.  I've searched a lot of code but can't quite get the name effectively to use.

 

TIA,

Mike

 

*Happy Memorial Day!!

0 Likes
368 Views
2 Replies
Replies (2)
Message 2 of 3

paullimapa
Mentor
Mentor

**added save file portion**

try this code:

 

(setq name(cdr (assoc 1 (entget (cdr (assoc 340 (entget (car(entsel)))))))))

Here's the code to save the drawing using image name: 

(command"_.SaveAs" "" (strcat (vl-filename-directory name) "\\" (vl-filename-base name)))

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

Like other answer use "getfiled" to select the TIFF than use imageattach that way you know the image name. 

 

(getfiled "Select Tiff " "" "tif" 0) do some home work re the blank "" entries.

0 Likes