Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, i'm developing an C# addin for Inventor 2023.
I've already managed a way to get all the rules in a determined document and remove each one.
I want a way to get all existing forms in the document and delete.
Here is what I already have:
const string iLogicAddinGuid = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}";
Inventor.ApplicationAddIn addin;
try
{
addin = Global.InventorApplication.ApplicationAddIns.get_ItemById(iLogicAddinGuid);
}
catch
{ return; }
Document document = Global.InventorApplication.ActiveDocument;
if (addin != null)
{
if (!addin.Activated)
addin.Activate();
dynamic automation = addin.Automation;
System.Collections.IEnumerable ruleCol = automation.get_Rules(document);
if (ruleCol is null)
{
MessageBox.Show("empty");
return;
}
else
{
foreach (dynamic item in ruleCol)
{
MessageBox.Show(item.Name);
}
automation.DeleteAllRulesInDocument(document);
}
}
Solved! Go to Solution.