Hey Community
I only knew macros from Excel. Now I tried to write my own first macro for Inventor witch will export my drawing as a PDF and DXF.
I used the transcript feature to record my action and copy them into my macro.
For the PDF Part it worked so far, with the help of some similar posts in this forum.
But I'm really stuck with the dxf part.
For the transcript you see below I opend Inventor, opend a drawing (a nearly empty drawing I use as a template), exported it and closed inventor again. So the beginning and the end of the transcript are clear for me.
At the export-part I loaded in my dxf-config.ini file to make my life easier but it still shows all the line types and other stuff. In my macro I have the problem exactly there. I'm not sure if I can delete that part, but if I comment it out it gives an error as well if I leave it as is.
I also tried splitting the two long lines so that I wouldn't run in any limitations. But it still gives my various errors.
I'm also not sure why there are lines about DWG export, because I didn't export any.
I hope someone can clarify this for me
Thanks in advance
( I use Inventor 17)
'Inventor Transcript File
'Autodesk Inventor 2017
'Build: 256, Release: 2017.4.1 - Date: Thu 06/15/2017
'Build Number: 213256000
'Sat Aug 12 16:16:11 2017
'User Name - Admin
Dim Inventor as Application
Dim ActiveDocument as Inventor.Document
Inventor.Execute("OpenDocument","DocumentPathName=C:\Users\Public\Documents\Autodesk\Inventor 2017\Templates\pgr.idw;AsTemplate=0;AllowRetry=0;AllowIgnore=0;")
ActiveDocument.Execute("Document1","CheckDocument","DocumentName=Document1;NewDocument=0;Version=6;AllowRetry=0;AllowIgnore=0;")
Inventor.Execute("OpenFrame","DocumentName=Document1;AllowRetry=0;AllowIgnore=0;")
Set ActiveDocument = Inventor.Execute("ActivateDocument","FrameName=Frame1;AllowRetry=0;AllowIgnore=0;")
Inventor.Execute("LoadTransExt","FileExtension=.dxf;TranslatorId={C24E3AC4-122E-11D5-8E91-0010B541CD80};AllowRetry=0;AllowIgnore=0;")
Inventor.Execute("ReadOptionsFile","Options File Path=C:\Users\Admin\Desktop\AddInn\dxf-config.ini;Options File Type=Export;AutoCAD Version=8;Is AutoCADM=0;Use Transmittal=0;Use Customize=0;Customize File=C:\Users\Public\Documents\Autodesk\Inventor 2017\Design Data\DWG-DXF\FlatPattern.xml;Create Layers Group=0;Translate Parts Only=0;Explode Dims=0;Symbols Blocked=1;Selected Properties=[];AutoCAD Template=;Space To Export To=0;Translation Scaling=0;Object Mapping Type=1;Model Views Only=1;File To Be Translated=;Options File Path=;Translate All Sheets=1;Destination DXF=1;Names of Sheets to Translate=[];Line Type File Name=C:\Users\Public\Documents\Autodesk\Inventor 2017\COMPATIBILITY\Support\invDIN.lin;Export Line Type Map=[Continuous:28100:0,000000,DASHED:28101:0,000000,DASHED_SPACE:28102:0,000000,LONG_DASH_DOTTED:28103:0,000000,LONG_DASH_DOUBLE_DOT:28104:0,000000,LONG_DASH_TRIPLE_DOT:28105:0,000000,DOTTED:28106:0,000000,CHAIN:28107:0,000000,DOUBLE_DASH_CHAIN:28108:0,000000,DASH_DOUBLE_DOT:28109:0,000000,DASH_DOT:28110:0,000000,DOUBLE_DASH_DOT:28111:0,000000,DOUBLE_DASH_DOUBLE_DOT:28112:0,000000,DASH_TRIPLE_DOT:28113:0,000000,DOUBLE_DASH_TRIPLE_DOT:28114:0,000000,];Use ACI For Entities And Layers=0;Replace_Spline=0;Chord_Tolerance=0.001;Allow Raster Views=0;AllowRetry=0;AllowIgnore=0;")
' -- Transaction Begin Sat Aug 12 16:18:26 2017
ActiveDocument.Execute("Document1","DWGDataExport","AutoCAD Version=8;Is AutoCADM=0;Use Transmittal=0;Use Customize=0;Customize File=C:\Users\Public\Documents\Autodesk\Inventor 2017\Design Data\DWG-DXF\FlatPattern.xml;Create Layers Group=0;Translate Parts Only=0;Explode Dims=0;Symbols Blocked=1;Selected Properties=[];AutoCAD Template=;Space To Export To=0;Translation Scaling=0;Object Mapping Type=1;Model Views Only=1;File To Be Translated=C:\Users\Admin\Desktop\test\pgr.dxf;Options File Path=;Translate All Sheets=1;Destination DXF=1;Names of Sheets to Translate=[];Line Type File Name=C:\Users\Public\Documents\Autodesk\Inventor 2017\COMPATIBILITY\Support\invDIN.lin;Export Line Type Map=[Continuous:28100:0,000000,DASHED:28101:0,000000,DASHED_SPACE:28102:0,000000,LONG_DASH_DOTTED:28103:0,000000,LONG_DASH_DOUBLE_DOT:28104:0,000000,LONG_DASH_TRIPLE_DOT:28105:0,000000,DOTTED:28106:0,000000,CHAIN:28107:0,000000,DOUBLE_DASH_CHAIN:28108:0,000000,DASH_DOUBLE_DOT:28109:0,000000,DASH_DOT:28110:0,000000,DOUBLE_DASH_DOT:28111:0,000000,DOUBLE_DASH_DOUBLE_DOT:28112:0,000000,DASH_TRIPLE_DOT:28113:0,000000,DOUBLE_DASH_TRIPLE_DOT:28114:0,000000,];Use ACI For Entities And Layers=0;Replace_Spline=0;Chord_Tolerance=0.001;Allow Raster Views=0;AllowRetry=0;AllowIgnore=0;")
' -- Transaction End Sat Aug 12 16:18:26 2017 (ReqId=1)
Inventor.Execute("CloseFrame","FrameName=Frame1;AllowRetry=0;AllowIgnore=0;")
Set ActiveDocument = Inventor.Execute("ActivateDocument","AllowRetry=0;AllowIgnore=0;")
Inventor.Execute("CloseDocument","DocumentName=Document1;AllowRetry=0;AllowIgnore=0;")