Visual Lisp script for link photo from autocad block attribute
This visual lisp script creates a link between
the autocad block attribute 'ID_pnt' (see photo)
and the photo in the corresponding directory (see example c:\sample\x_foto\TB???, TB001, TB002 etc)
The command 'Link' (file link_photo.lsp)syntax is:
String value for name directory (see example c:\sample\x_foto\)
Selection autocad block (see example file sample.dwg block TB001,TB002 etc.)
Open dialog window "Link photo"
Syntax of the commands:
View photo - open photo with 'startapp' command
see example the string is "C:\\Users\\xxxxxxx\\AppData\ \Local\\Google\\Chrome\ \Application\\Chrome.exe" and use chrome.exe.
Change the string value for your browser or another application (compatible with photos extension)
next/previous - allow to scroll for all photos in the directory
name photo - indicates the name of the selected photo
nr photo - indicates the number of photos in the selected directory
Select new block - allows to select a new
block and the corresponding photos
Extract all file and copy to c:
In case of problem with dialog box windows (autocad don't find file base.dcl) follow these steps:
1)write in the command line : '_options'
3)select 'support file search path'
5)select destination path 'Program Files/AutoCAD 2015(yourversion)/UserDataCache/en-EN(yourlenguage)/support' and press 'ok'
The script also contains the command 'make_dir', which allows you to create directories related to
autocad blocks (ex. TB001, TB002, TB003 etc.)
The command 'make_dir':
Insert number of the directories to be added - integral for the number of directories to be created
Insert name directory - insert string, example 'TB'
Directory position - insert a string for directory position, exemple c:/sample/x_foto)