- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an Inventor C# AddIn.
How can the Inventor API in an assembly (.iam)
change the file reference to a Revit file (.rvt)?
So I have an IAM in which a "D:\Old.rvt" is embedded.
I want to change the reference in the IAM to "D:\New.rvt".
"...Descriptor.ReplaceReference" does not work.
And with the following, the "Delete" method does not work:
AssemblyDocument oAss = ...
dynamic assemblyComponentDefinition = oAss.ComponentDefinition;
dynamic importedComponents = assemblyComponentDefinition.ImportedComponents;
dynamic importedComponentDefinition = importedComponents.CreateDefinition("D:\New.rvt");
if(importedComponents.Count > 0)
{
dynamic ic = importedComponents.Item(1);
ic.Delete(); // Method not implemented!
}
dynamic importedComp = importedComponents.Add(importedComponentDefinition);
Solved! Go to Solution.
