I have a VB6 program which adds various custom properties to a part file but I would like to make the 'Hardware part' property in the Project tab active when the program is run. Can anyone pleae help with the code to do this?
Posted by: Paul Collins
Post date: 1/5/2009 8:49:43 PM
If you've got a handle to the part model:
objDoc.Properties.Item("ExtendedSummaryInformation").Item("Hardware").Value = True
Posted by: Bill Ledbetter
Post date: 1/6/2009 12:38:31 AM
Has anyone got any idea why this doesn't seem to work in visual studio (2013). I just get an error message:-
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
This is the full error message
Message=Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32 aWrapperTypes, MessageData& msgData)
at SolidEdgeFramework.Properties.Item(Object vIndex)
at SE_Data_JCBT.Module1.WriteTextBoxes() in C:\Visual Studio Desktop\SE_Data_JCBT\Module1.vb:line 220
the error indicates that the property you're trying to access can't be found.
So check for possible spelling error and be aware that the property "Hardware" of the category "ExtendedSummaryInformation" is available only for PAR/PSM documents.
I realsied that the property couldn't be found but the same code still works OK in VB6. I tried another couple of ExtendedSummaryInformation properties and they worked. Maybe it is a Visual Studio problem. If it can't bo done I will have to forget it - it was just a nice option to include in my program.
Thanks for your help.