Aftertouch Posted June 10, 2022 Share Posted June 10, 2022 Hi all, Is it possible to check the mailadress that the user used to sign into the application? I managed to collect it from Outlook, but thats nog 100% trustworthy. Cannot find anything about this subject on the webs. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
tombu Posted June 10, 2022 Share Posted June 10, 2022 Not directly but you can easily get their username with (getenv "USERNAME"). For most offices the rest of their email addresses are the same and could easily be added on. I use it in code to both add the users name to a drawing and to add a link to open their network folder. 1 Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted June 10, 2022 Author Share Posted June 10, 2022 Hi Tombu, My users have 7 different email extentions, 7 companies in 1 holding. I would like to set certain variables based on there extention. I could ask to give there extention on first login, but you'd say the login mailadress should be accessable... Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 10, 2022 Share Posted June 10, 2022 2 minutes ago, tombu said: Not directly but you can easily get their username with (getenv "USERNAME"). For most offices the rest of their email addresses are the same and could easily be added on. I use it in code to both add the users name to a drawing and to add a link to open their network folder. Also to link to someones documents folder (strcat (getenv "userprofile") "\\Documents\\") 1 Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 10, 2022 Share Posted June 10, 2022 I'm guessing this is for a user license? Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted June 10, 2022 Author Share Posted June 10, 2022 Hi, Its for a script that imports company logo's into the DWG based on the 'users company. I got it running with the Outlook check, but when Outlook is offline, its not working. Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 10, 2022 Share Posted June 10, 2022 Ah i use where the file is saved for that. (if (wcmatch (getvar 'DWGPREFIX) "*Client*") (vl-cmdf "_.Insert" (strcat (getenv "userprofile") "\\LOGO\\client_LOGO.dxf") pause "" "" "") Quote Link to comment Share on other sites More sharing options...
tombu Posted June 10, 2022 Share Posted June 10, 2022 (edited) 55 minutes ago, Aftertouch said: Hi Tombu, My users have 7 different email extentions, 7 companies in 1 holding. I would like to set certain variables based on there extention. I could ask to give there extention on first login, but you'd say the login mailadress should be accessable... I use the attached lisp to set the Author in a drawings property to the name they prefer derived from their "USERNAME" assigned in Windows using the macro ^C^C^P(load "Author.lsp")(Author). You could modify it to derive the email associated from their "USERNAME" if you know all their usernames and email addresses. Author.lsp Edited June 10, 2022 by tombu 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted June 10, 2022 Share Posted June 10, 2022 .,, If you know all the user names and email addresses..... which might mean a lot of updating in a company with staff changes? If I am reading this right then if Outlook is running you can get the current users e-mail address? Working off line and you can't? The e-mail domain indicates the company the user works for and so the data to put into the drawing. Using Tombus idea of a database of user names, I think this could be created dynamically, little user interaction. If and when the user is working in CAD, and is online with outlook could you copy their e-mail address to a separate text file, create a bit of a database that way. Each time a users opens up CAD, check their details in the text file, if not there check outlook, if outlook isn't online give them a pop-up to ask, then write those details to the text file? Saved centrally for all users or locally for a single user in the windows temps folder or somewhere, Might be you could include name (from Wndows user name), their e-mail, the company they work for, and perhaps a last checked (for tidying up the database depends how big it gets, delete anyone who hasn't signed in within 18 months (allowing for maternity leave you see)) 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 11, 2022 Share Posted June 11, 2022 I just did something similar and just have a list of company names that appears in a list box so select client, it then pops a new box with that clients title block options like A1, A1-por,A3 etc then asks how many and makes all the new layouts with that client title block. All the title blocks are in one master dwg so just use layout to select from a dwg. 1 Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted June 14, 2022 Author Share Posted June 14, 2022 Hi all, thanks for the sugestions. For now, ill stick to the Outlook version i have. I dont want to keep a database of any sort. way to much people for that. If Outlook is offline, it'll prompt them to use a picklist themself. Quick and dirty fix. unbeleavable it is so had to access the logged in user mailadress lol. Quote Link to comment Share on other sites More sharing options...
Steven P Posted June 14, 2022 Share Posted June 14, 2022 5 hours ago, Aftertouch said: unbeleavable it is so had to access the logged in user mailadress lol. You are wanting 1 program to talk to another program, both do very different things and are made by different companies... not that unbelievable really.... Quote Link to comment Share on other sites More sharing options...
SLW210 Posted June 14, 2022 Share Posted June 14, 2022 You might read through Find local user Email address? - Autodesk Community - AutoCAD. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.