By Wayne Brill
You may want to turn off certain commands in a document. To do this use a property on the Document called "DisabledCommandTypes". Through this property, you can disable entire classes of commands. This is a way to make a part behave similar to a part in content library. For example you could have is a document and have Inventor UI grey-out all of the geometry modifying commands when it is the active document, but keep the File Property edit commands enabled. (the setting is saved with the document)
Dim m_inventorApp As Inventor.Application
m_inventorApp = System.Runtime.
Dim oDoc As Document
oDoc = m_inventorApp.ActiveDocument
'Disable all editing commands.
'Enable all editing commands.
' oDoc.DisabledCommandTypes = 0
hr = ::CLSIDFromProgID (L"Inventor.Application",
//latch on to existing one
hr = ::GetActiveObject
(InvApplicationClsid, NULL, &pInvAppUnk);
hr = pInvAppUnk->QueryInterface
(__uuidof(Application), (void **) &Inv);
hr = Inv->get_ActiveDocument(&Doc);
//Disable all feature editing commands
hr = Doc->put_DisabledCommandTypes