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
[RESOLVED] Sim Object
Re: Sim Object
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
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
-
- Posts: 15
- Joined: Mon Feb 12, 2018 9:20 pm
Re: Sim Object
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
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
Re: Sim Object
Hi Seth,
I'd suggest you define
and then check the returned HRESULT of GetObject() for any problem as to why ppObject isn't filled:
Maybe this helps.
Greets, Benny.
I'd suggest you define
Code: Select all
CComPtr<IBaseObjectV400> ppObject = nullptr;
Code: Select all
HRESULT hr = ObjectManager->GetObject(ResObjID, &ppObject);
Greets, Benny.
-
- Posts: 15
- Joined: Mon Feb 12, 2018 9:20 pm
Re: Sim Object
Benny,
Thank you that was it!
Seth
Thank you that was it!
Seth
Re: Sim Object
Glad you got it solved.
All the best,
Benny
All the best,
Benny