I'm currently trying to build my first C++ AddOn, but I'm struggeling a bit.
I'm trying to set a property for selected elements, but the part where I set doesn't seem to work.
My current code looks/works somewhat like this:
1) I get the selected Elements with ACAPI_Selection_Get
static void getSelectedElements(GS::Array<API_Neig>& selNeigs)
err = ACAPI_Selection_Get(&selectionInfo, &selNeigs, true);
2) Looking for the Property I want to edit (2 Steps)
This method finds the wanted PropertyGroup by its name
This method above gets used in the following:
propertyDefintion will then have the information for our user-defined property ["Identifizierung","Bezeichnung"]
With the selected Neigs and the propertyDefinition accuired i wanted to use
to get the property of the Element and edit it
but after I call
none of the selected Elements have a changed their value of Bezeichnung.
So how can i edit a property of an element? What am i missing?
And on a side note, this my very first AC/C++ AddOn, so if you get any recommendations for my code (readability, performance or general things) those are much appreciated 🙂
Solved! Go to Solution.
Thanks four your help, i tried it out and encapsulated the important bits of the addon:
the method "numberBezeichnung()" then gets called in MenuCommandHandler.
But when i execute the AddOn, no values get changed. To check if my selection works i added the line
DG::InformationAlert(GS::ValueToUniString(selNeigs.GetSize()), "", "Ok");
which returns me after executing the addon the amount of the selected elements, which works.
Any idea why that still happens?