Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AddMateiMateDefinition help, help, help...

1 REPLY 1
Reply
Message 1 of 2
Anonymous
275 Views, 1 Reply

AddMateiMateDefinition help, help, help...

Hi everyone,



I'trying to use AddMateiMateDefinition.



The following statement works fine :



hr=piMateDefinitions->AddMateiMateDefinition( pEntity

, CComVariant(0)

, kNoInference

, vtMissing // const VARIANT & BiasPoint

, bstrName

, CComVariant() // Match Lis

, &pMateiMateDefinition);



but, as you can see, Match List is empty.



How must I pass the Match List ?



Whit any other argument but CComVariant() the statement assert.



Thankyou in advance.



Ezio








1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Here is my solution :



VARIANT pVarResult;//here's the VARIENT result

VariantInit(&pVarResult);//initialize it

pVarResult.vt = VT_ARRAY|VT_BSTR;//tell it what datatype to return. I doubt very much this is IItem



SAFEARRAY * psa;

SAFEARRAYBOUND rgsabound[1];



rgsabound[0].lLbound = 0;

rgsabound[0].cElements = 3;

psa = SafeArrayCreate(VT_BSTR, 1, rgsabound);



BSTR* pRawData;

HRESULT hr=SafeArrayAccessData(psa, reinterpret_cast<void HUGEP**>(&pRawData));



CString str="Alida";

pRawData[0]=str.AllocSysString();

str="Nicholas";

pRawData[1]=str.AllocSysString();

str="Cecilia";

pRawData[2]=str.AllocSysString();



SafeArrayUnaccessData( psa);



pVarResult.parray=psa;

piMateDefinition->PutMatchList( pVarResult);





Ezio

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report