- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an iLogic rule that pages through all members of an ipart or iassembly, letting me see each one so that if it doesn't look "right", I can go back and fix it.
DimappAsInventor.Application=ThisApplication
DimoDocAsInventor.Document=app.ActiveDocument
DimoCompDefAsComponentDefinition=oDoc.ComponentDefinition
DimcurrowAsInteger
DimopFactoryAsiPartFactory
DimopRowAsiPartTableRow
InventorVb.DocumentUpdate()
opFactory=ThisApplication.ActiveDocument.ComponentDefinition.iPartFactory
currow=opFactory.DefaultRow.Index
opFactory.DefaultRow=opFactory.TableRows.Item(1)
' Iterate through the rows
ForEachopRowInopFactory.TableRows
opFactory.DefaultRow=opRow
Next
opFactory.DefaultRow=opFactory.TableRows.Item(currow)
Now I'd like to take it a little further. If one of the members has an error of some kind - a feature that can't compute, or constraints that are in conflict, anything that would cause Design Doctor to pop up - I'd like the rule to stop running at that problem member and allow the user to correct it on the spot.
I know I can call the Design Doctor:
ThisApplication.CommandManager.ControlDefinitions.?Item("AppDesignDoctorCmd").Execute()
but I don't know how or if I can read some value related to Design Doctor that tells me whether it wants to pop up. My code currently just activates each member and continues regardless of whether there is an error. When the code activates a problem member, the red cross doesn't highlight to indicate a problem; however, if I were to activate that member manually, Design Doctor would be initiated.
Is there a way ( I would think so) to determine in the code whether a table member contains errors that would turn on the Design Doctor? Do I need some kind of delay to allow Inventor to process and recognize problems in the table?
Solved! Go to Solution.