000

Index Labels

Using Inventor iLogic to Create E-Mail Notifications with Outlook

.
Issue:
When you've made a design change, you'd like to use iLogic to create an email notification with the current file as an attachment to be sent to your client.



Solution:
Here is a sample code that will do the following tasks:

  • Time Stamp the current file
  • Fill out the status iProperties for the current file
  • Save the current file
  • Create a new email using Outlook that is addressed to the client's email
  • Add a basic message
  • Add the current file to the email as an attachment
  • Display the email (but don't send it)


'------- start of iLogic code -------------------


 ' Start Outlook.
 ' If it is already running, you'll use the same instance...
   Dim oOApp
   oOApp = CreateObject("Outlook.Application")
   
' Log on. Doesn't hurt if you are already running and logged on...
   Dim olNs
   olNs = oOApp.GetNamespace("MAPI")
   olNs.Logon

‘get the Inventor user name from the Inventor Options
myName= ThisApplication.GeneralOptions.UserName

'get current time
oTime = Now.ToShortTimeString

'set status tag to For Review and time stamp
iProperties.Value("Status", "Status") = "For Review @ " oTime

'set the Design State to Pending
iProperties.Value("Status", "Design State") = "Pending"

'set the Checked By to user name from the Inventor Options
iProperties.Value("Status", "Checked By") = myName

'set the Checked Date to the current date
iProperties.Value("Status", "Checked Date") = Now

'save the file
ThisDoc.Save

'send email using outlook
Dim oOMail

oOMail = oOApp.CreateItem(olMailItem)

With oOMail
            'replace with your client's email address
            .To = "myclient@domain.com"
            .Subject = "Please Review: " & ThisDoc.FileName
          .Body = "Please review " & ThisDoc.FileName & " and let me know if you see any issues."
            .Body = .Body & "Thanks, " & myname
            .Display

            'Add attachments to the message.
            objOutlookAttach = .Attachments.Add(ThisDoc.PathAndFileName(True))

End With
'------- end of iLogic code -------------------



The end result is an email waiting for you to hit the send button:


 Here are the results of the Status iProperties that are being set:



 To send an email automatically from iLogic, you can add .Send as in this example:

'------- Start of iLogic code -------------------

'send email using outlook
Dim oOApp
Dim oOMail

oOApp = CreateObject("Outlook.Application")
oOMail = oOApp.CreateItem(olMailItem)

With oOMail
.To = "name@domain.com"
.Subject = "Some Subject Line Here"
.Body = "Some Text Here"
'Add attachments to the message
objOutlookAttach = .Attachments.Add(ThisDoc.PathAndFileName(True))
.Send
End With
'------- end of iLogic code -------------------


Update: 5-27-2014
  For more on this topic, see this link for Clinton Brown's blog article "iLogic- Email your Part Files with EOP Rolled Up"


Blog Archive

Labels

3D Modeling 3D rendering 3D scanning 3D Sketch Inventor AI Design AI in Manufacturing AI Tools architectural modeling architectural visualization Architecture architecture design Architecture Productivity Artificial Intelligence AutoCAD AutoCAD advice AutoCAD Basics AutoCAD Beginners AutoCAD Civil3D AutoCAD commands AutoCAD efficiency AutoCAD features AutoCAD File Management AutoCAD Layer AutoCAD learning AutoCAD print settings AutoCAD productivity AutoCAD Teaching AutoCAD Techniques AutoCAD tips AutoCAD training. AutoCAD tricks AutoCAD Tutorial AutoCAD workflow AutoCAD Xref Autodesk Autodesk 2025 Autodesk 3ds Max Autodesk AI Tools Autodesk Alias Autodesk AutoCAD Autodesk BIM 360 Autodesk Dynamo Autodesk Fusion 360 Autodesk InfraWorks Autodesk Inventor Autodesk Inventor Frame Generator Autodesk Inventor iLogic Autodesk Recap Autodesk Revit Autodesk Software Autodesk Tips Autodesk Vault Autodesk Video Automation Automation Tutorial automotive design automotive visualization Basic Commands Basics Beginner Beginner Tips BIM BIM collaboration BIM Implementation BIM software BIM technology Block Editor ByLayer CAD comparison CAD Data Management CAD Design CAD File Size Reduction CAD line thickness CAD modeling CAD Optimization CAD Productivity CAD software car design software CGI design Civil 3D civil engineering Class-A surfacing clean CAD file cleaning command Cloud Collaboration Cloud design platform command abbreviations concept car Construction Technology Contraints Create resizable blocks CTB STB Data Backup Data Reference Data Shortcut Design Automation design software Design Workflow Digital Design Digital engineering digital fabrication Digital Twin Digital Twins Drafting Standards Drawing Automation Dref Dynamic Block Dynamic Block AutoCAD Dynamic Blocks Dynamic doors Dynamic windows eco design editing commands energy efficiency Engineering Engineering Design Engineering Innovation Engineering Technology engineering tools Engineering Workflow Excel Express Tools External Reference Fast Structural Design Fusion 360 Generative Design Global design teams green building Grips heavy CAD file Heavy CAD Files iLogic Industry 4.0 infrastructure design Infrastructure Monitoring InfraWorks Insight Inventor API Inventor Drawing Template Inventor Frame Generator Inventor Graphics Issues Inventor IDW Inventor Tips Keyboard Shortcuts Large Projects Learn AutoCAD Linked Models Machine Learning in CAD maintenance command Management Manufacturing Innovation Mesh-to-BIM Metal Structure Model Optimization ObjectARX .NET API Organization OVERKILL OVERKILL AutoCAD Palette parametric design PDF Plot Style AutoCAD point cloud Practice Drawing Predictive Maintenance Printing Quality Product Design professional printing Professional Tips PTC Creo PURGE PURGE AutoCAD ReCap reduce CAD file size rendering software Resizable Block Revit Revit automation Revit Best Practices Revit Performance Revit Scripting Revit Tips Revit Workflow Ribbon screen shortcut keys Shortcuts Siemens NX Sketch Small Firms Smart Block Smart Factory Smart Infrastructur SolidWorks Steel Structure Design sustainability sustainable design Sustainable Manufacturing toolbar Tutorial urban planning User Interface (UI) Vault Best Practices Vault Lifecycle Vault Mistakes vehicle modeling visualization workflow Workbook workflow Workflow Optimization Worksets Worksharing Workspace XLS Xref