Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP to attach all files with same name to email

24 REPLIES 24
SOLVED
Reply
Message 1 of 25
JCprog
1535 Views, 24 Replies

LISP to attach all files with same name to email

Hello everyone!

 

I need help on LISP routine that will launch new email outlook and attach all files with same name as drawing name (no matter what the extension is) in same directory. Please help!!!! Thanks in advance 🙂
 

24 REPLIES 24
Message 21 of 25
hmsilva
in reply to: JCprog


@JCprog wrote:

It worked!!!!!!!!!!!Smiley Very Happy Thank you very much Henrique!!!!!!!!!!

 

The only thing is it also grabs .dwl files that acad generates when drawing file is open.

 


You're welcome, JCprog

 

Replace the filelst function by this one

 

(defun filelst (/ LST NAME PATH)
  (setq	path (getvar 'DWGPREFIX)
	name (vl-filename-base (getvar 'DWGNAME))
  )
  (foreach x (vl-directory-files path nil 1)
    (if	(and (wcmatch (vl-filename-base x) name)
	     (not (wcmatch (vl-filename-extension x) ".dwl2,.dwl"))
	)
      (setq lst (cons (strcat path x) lst))
    )
  )
  lst
)

HTH

Henrique

 

 

EESignature

Message 22 of 25
JCprog
in reply to: hmsilva

Works Perfect!!!! Thanks again Henrique!!!!
Message 23 of 25
hmsilva
in reply to: JCprog

You're welcome, JCprog
Glad I could help

Henrique

EESignature

Message 24 of 25
mid-awe
in reply to: hmsilva

Nice one Henrique.
This is less than half the code of the version I had put together a few years back. I stopped in thinking I was able to contribute =D I love this forum.

Thank you.
Message 25 of 25
hmsilva
in reply to: mid-awe

Thank you, mid-awe,
but all credits from the "rjp-OutlookMessage" function going to ronjonp, I just put it together with the "filelst" function to suit the OP...

 

Cheers
Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost