Get ID issue with EdmCmdNode_ParentDocIDs

I can’t get id with EdmCmdNode_ParentDocIDs in IEdmCmdNode interface

IEdmCmdNode cmdNode = (IEdmCmdNode)cmdData.mpoExtra;
int childdocid = (int)cmdNode.GetProperty(EdmCmdNodeProp.EdmCmdNode_ParentDocIDs);

The Error Code is below.

Message "Method returned a COM Variant type that is not Interoperable."
System.StubHelpers.ObjectMarshaler.ConvertToManaged(IntPtr pSrcVariant)

I have actually not used that before. I would probably use let the compiler infer the type.

var childdocid = cmdNode.GetProperty(EdmCmdNodeProp.EdmCmdNode_ParentDocIDs);

@AmenJlili
i tried that but wasnt run. i get same error

Check if your pdm dlls embed interop types (from the reference properties) are set to false.

i checked it unfortunately same error

Managed Debugging Assistant 'InvalidVariant' 
  Message=Managed Debugging Assistant 'InvalidVariant' : 'An invalid VARIANT was detected during a conversion from an unmanaged VARIANT to a managed object. Passing invalid VARIANTs to the CLR can cause unexpected exceptions, corruption or data loss.'

Might worthwhile to report this to apisupport@solidworks.com

1 Like

https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/#community:yUw32GbYTEqKdgY7-jbZPg/iquestion:uO3FkguzS9uA1sSA9gCBBw

I found a thread from 2011 on forum.
Service Request Opened: [SR:1-24194241319]

That’s a shame :frowning: 11 years and still a bug

1 Like