[RESOLVED] Sim Object

skeadle6309
Posts: 9
Joined: Mon Feb 12, 2018 9:20 pm

[RESOLVED] Sim Object

Postby skeadle6309 » Tue Jan 08, 2019 5:58 pm

I have been scrolling through the SDK documentation and have not been able to find any information on this... but I have UINT ObjectId and I am curious if there is anyway to get the name of the component with that id. Currently using the RayTraceManager to get the returnOnjectId but can not figure out what exactly the returning object is.

Thanks for any help

BenBaron
Posts: 48
Joined: Fri Jan 16, 2015 7:51 am

Re: Sim Object

Postby BenBaron » Tue Jan 08, 2019 8:26 pm

Hi,

you could use the ISimObjectManager and call the GetObject() method on it, which takes an UINT idObject. On the returned IBaseObjectV400 **ppObject you could then call GetTitle() which gives you a LPWSTR pszCfgTitle as out argument.

Greets, Benny

skeadle6309
Posts: 9
Joined: Mon Feb 12, 2018 9:20 pm

Re: Sim Object

Postby skeadle6309 » Wed Jan 09, 2019 5:57 pm

Hi Benny,

Thanks for the assistance! So I have:


CComPtr<ISimObjectManagerV440> ObjectManager;
IBaseObjectV400 **ppObject;
...
ObjectManager->GetObject(ResObjID, ppObject);
...

I am able to see in debug mode that the ResObjId is passing the correct value but I am never getting a return **ppObject

Thanks
Seth

BenBaron
Posts: 48
Joined: Fri Jan 16, 2015 7:51 am

Re: Sim Object

Postby BenBaron » Wed Jan 09, 2019 7:35 pm

Hi Seth,

I'd suggest you define

Code: Select all

CComPtr<IBaseObjectV400> ppObject = nullptr;
and then check the returned HRESULT of GetObject() for any problem as to why ppObject isn't filled:

Code: Select all

HRESULT hr = ObjectManager->GetObject(ResObjID, &ppObject);
Maybe this helps.

Greets, Benny.

skeadle6309
Posts: 9
Joined: Mon Feb 12, 2018 9:20 pm

Re: Sim Object

Postby skeadle6309 » Wed Jan 09, 2019 7:56 pm

Benny,

Thank you that was it!

Seth

BenBaron
Posts: 48
Joined: Fri Jan 16, 2015 7:51 am

Re: Sim Object

Postby BenBaron » Wed Jan 09, 2019 8:21 pm

Glad you got it solved.

All the best,

Benny


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 1 guest