Modeler::SightPtr currentSightPtr; GSErrCode err = ACAPI_3D_GetCurrentWindowSight ((void**)¤tSightPtr);Perhaps this is not in the doco because Modeler::SightPtr is undocumented.
GSModeler::ModelFuncTable *funcTable = EXPGetModelFunctionTable (); if (funcTable == NULL) return APIERR_CANCEL; GSModeler::Model::SetFuncTable (funcTable); void* currentSightPtr; if (ACAPI_3D_GetCurrentWindowSight (¤tSightPtr) != NoError) return APIERR_CANCEL; GSModeler::Model model; Modeler::Sight* sight = static_cast<Modeler::Sight*> (currentSightPtr); if (EXPGetModel (sight->GetConstMainModelPtr (), sight->GetSunSettings (), &model) != NoError) return APIERR_CANCEL;
Modeler::SightPtr currentSightPtr; GSErrCode err = ACAPI_3D_GetCurrentWindowSight ((void**)¤tSightPtr);A Modeler::SightPtr happens to be a GS::SharedPtr<Sight>, which is not the same as a raw Sight* pointer.
void* dummy = nullptr; ACAPI_3D_GetCurrentWindowSight(&dummy); Modeler::SightPtr currentSightPtr((Modeler::Sight*)dummy); // init the shared ptr with the raw pointer ModelerAPI::Model acModel; AttributeReader attrReader; EXPGetModel(currentSightPtr, &acModel, &attrReader);
drjustice wrote:You are responding to an 8 year old thread... is your comment really about the AC 17 devkit / API ... or about a more recent version?
I would like to confirm that the code posted by paulk is indeed incorrect.
drjustice wrote:You could start a new topic in this Developer Forum about this... legacy API / API documentation. Some of the things are ancient...and have more modern wrappers now, but are still there for legacy support (without requiring heavy updates to add-on code), others are newer and more object oriented. Not being a profit center, a full, clean update of the API, data structures and documentation is not likely. Also, because it relies on proprietary code - and access to the actual product code - it is not something that can be made open source / community-driven either.
ike, I don't understand why you have 12 different data structures that do the same thing, in different namespaces, some types that are classes but some that have constructors some that don't, some that use void pointers, some that use templates, some type names that are missing letters, some that you must initialize not with a constructor, but with BNZeroMemory, and that the SDK provides header files that are there for whatever purpose but that we're not allowed to use other than to make things compile, some classes that we are allowed to use but when you call some of their methods you get unresolved externals, and so on...