- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to place my sample ipt file at the point in the coordinates I want in an iam file that I open with the Inventor api. My iam file is opening but I am getting this error when trying to add my ipt file. How can I fix this?
Application oApp = _application;
Application application = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
string fullpath = "C:\\Users\\user\\Desktop\\part1.iam";
var prt = application.Documents.Open(fullpath);
prt.UnitsOfMeasure.LengthUnits = UnitsTypeEnum.kMillimeterLengthUnits;
PartDocument prt2 = (PartDocument)application.Documents.Add(DocumentTypeEnum.kPartDocumentObject, application.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject), true);
PartComponentDefinition cdef = prt2.ComponentDefinition;
// Set a reference to the assembly component definition.
// Set a reference to the transient geometry object.
TransientGeometry oTG = oApp.TransientGeometry;
// Create a matrix. A new matrix is initialized with an identity matrix.
Matrix oMatrix = oTG.CreateMatrix();
// Set a reference to the transient geometry object.
// Create a matrix. A new matrix is initialized with an identity matrix.
oMatrix.SetTranslation(oTG.CreateVector(30, 0, 0));
// Add the first occurrence.
ComponentOccurrence oOcc1;
oOcc1 = cdef.Occurrences.Add(@"C:\Users\user\Desktop\door.ipt", oMatrix);
Error : "System.NotImplementedException: 'Unrealized (Exception from HRESULT: 0x80004001 (E_NOTIMPL))'"
Solved! Go to Solution.
Link copied