Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am wanting to create some iLogic that will be run from an assembly file, and it will look at each part and see if A-Side has been defined. If it has not been defined, it will delete the flat pattern (if one exists) and then pause and allow users to define A-Side. The portion of the code I am having issues with is below. If I run that from an individual part file, it works. However when I run a different rule from an assembly file that opens up all parts and then runs this rule, it does not work. It acts the same, but it does not actually define the A-Side.
Any help on this is much appreciated.
Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oCompDef As SheetMetalComponentDefinition oCompDef = oDoc.ComponentDefinition If oCompDef.ASideFaceStatus.ToString <> "kASideUpToDate" Then MessageBox.Show("MUST DEFINE A-SIDE " & iProperties.Value("Project", "Part Number"), "DEFINE A-SIDE", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop) End If 'Delete Flat Pattern if no A-Side If oCompDef.ASideFaceStatus.ToString <> "kASideUpToDate" Then iLogicVb.RunExternalRule("DELETE FLAT PATTERNS") End If 'Start Define A-Side Command If oCompDef.ASideFaceStatus.ToString <> "kASideUpToDate" Then Dim face As Inventor.Face face = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kPartFaceFilter, "Define A-Side") Call ThisApplication.CommandManager.ControlDefinitions.Item("SheetMetalCreateASideCmd").Execute End If
Solved! Go to Solution.