Archicad Python API
About automating tasks in Archicad using the Python API.
SOLVED!

Changing Change Marker name via python

Anonymous
Not applicable
Hi!

I'm running around this task the whole day and there is no working solution found.
I need to find all selected API_ChangeMarkerID = 4 items and change the name of each trough loop.

Plus, in the process I went from AC23 to AC24 and all the code from the previous version just stopped working at all (literally,what was the purpose to change it so drastically?)


offtop, letter of love to graphisoft:
BTW, Archicad's reference guides suck. All of them, especially the API one. Graphisoft, go look at webdev and see how it should be done. Your reference isnt indexed by google. Not mentioning the inner search being as crappy as it could be. Looks like you all are still in 80s. The GDL editor without line numbers, what? Ok, I use sublime, whatever. But come on, we pay so much for your product, you could've done better.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
runxel
Legend
I don't think it is possible at the moment (anyone correct me, if I'm wrong).
But GetAllElements() doesn't give you anything right now which isn't a model element, so I don't see a way to query the change markers...

You're right, the documentation is horrible at the moment. But it can only get better! And I strongly assume GS will improve the documentation, once the new API has settled in.
The change (more like a complete rehaul) of the API was made so we can actually be more flexible. I think the JSON interface is really powerful. Or .... will be. Let's see how it turns out.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

9 REPLIES 9
Solution
runxel
Legend
I don't think it is possible at the moment (anyone correct me, if I'm wrong).
But GetAllElements() doesn't give you anything right now which isn't a model element, so I don't see a way to query the change markers...

You're right, the documentation is horrible at the moment. But it can only get better! And I strongly assume GS will improve the documentation, once the new API has settled in.
The change (more like a complete rehaul) of the API was made so we can actually be more flexible. I think the JSON interface is really powerful. Or .... will be. Let's see how it turns out.
Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
Anonymous
Not applicable
Thank you for answer!
Maybe it could be done through C++? Any ideas on how to set it up?
Maybe there is any example of a working program or a tutorial?
Ralph Wessel
Mentor
IvanIvan wrote:
Thank you for answer!
Maybe it could be done through C++? Any ideas on how to set it up?
Maybe there is any example of a working program or a tutorial?
Yes, this is possible through the C++ API. Take a look at the Do_ChangeMarker_Edit function in the file "Element_Modify.cpp" of the example project "Element_Test". The name of the change marker is stored in API_Element.changeMarker.changeName
Ralph Wessel BArch
Anonymous
Not applicable
thank you! i shall be looking that way!
Anonymous
Not applicable
Ralph wrote:
IvanIvan wrote:
Thank you for answer!
Maybe it could be done through C++? Any ideas on how to set it up?
Maybe there is any example of a working program or a tutorial?
Yes, this is possible through the C++ API. Take a look at the Do_ChangeMarker_Edit function in the file "Element_Modify.cpp" of the example project "Element_Test". The name of the change marker is stored in API_Element.changeMarker.changeName
ahah, it all went too complicated: i compiled it without any significant errors the way it says here: https://helpcenter.graphisoft.com/knowledgebase/25738/ (i'm trying to fix the “This add-on cannot be validated. Please contact the distributor.”)...

but the ac23 doesnt want to load it, it says: “The selected file is not a All Add-Ons file. Please select a valid All Add-Ons file.” The original instruction is unclear, as always.

Now as i changed the hex in the config file, it says “This add-on cannot be validated. Please contact the distributor.” wtf
Ralph Wessel
Mentor
IvanIvan wrote:
the ac23 doesnt want to load it, it says: “The selected file is not a All Add-Ons file. Please select a valid All Add-Ons file.” The original instruction is unclear, as always.
If you're building one of the example projects, are you running Archicad in demo mode to test it? The example add-ons have no developer ID, so they only run in demo mode, i.e. they won't run in a licensed AC session.
Ralph Wessel BArch
Anonymous
Not applicable
yes, I understand that (still, it's very strangely done). but how can I build them so I can use them in my work environment? i tried to figure out how to set the developer id and so on (using the instruction here https://helpcenter.graphisoft.com/knowledgebase/25738/), but it doesnt work for me.
Ralph Wessel
Mentor
If you have a developer ID, you can create use that and create an ID for the add-on. You can find out more about that here: http://archicadapi.graphisoft.com/how-to-get-mdid-for-my-add-on
Ralph Wessel BArch
Anonymous
Not applicable
YAHOOO!!! Thank you! That worked! The name in that section must exactly match the file name of the .apx, otherwize it didn't work. As it turns out, there is no need to make any hexes or dance around the not-working Add-On Management program from the 22nd api folder (btw, the one in the 23rd doesnt run at all).

Thanks again! I hope that helps anyone else.


——
And as always, GRAPHISOFT, make proper instructions and reference guides — like Adobe, eg. Or you'll lose.