Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Home Story Name in Python

Arash
Contributor

Hello,

 

I noticed that the "Home Story Name" property in the General category is not accessible directly in Python, so I was wondering if there is something that I'm missing here. 

 

Could anyone please provide a sample code that extract "General_HomeStoryName" information of each element in python?

 

Thanks,

Arash

10 REPLIES 10

poco2013
Advisor

The "home Story Name" is not available to python scripts.

 

At Present, there are two workarounds.

 

You can create a user expression that references element home story and set its availability to all elements or selected Types. Then just reference that custom property. This expression returns the floor string name. The disadvantage is that the property must be ore-configured for all plans of interest.

 

The other one is to develop a AddOn to return that info via the ExecuteAddOnCommand, in Python and the floorInd attribute in the API_ELEM_HEAD structure in the AddOn API. This attribute returns the floor number. The disadvantage is that the AddOn must be pre-loaded to access it.

 

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

Hi Gerry,

 

Thank you for taking the time to read and answer my question. Do you think using Classification could be another work around?

 


@Arash wrote:

 Classification could be another work around?

 


I don't understand your question. The Classification system has nothing to do with the home story property or a expression. Properties,however, are made available to elements via their classification, -- so if you were to use a expression, it would have to belong to the the same classification as was the element(s).

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

Gerry,

 

I was thinking to create custom classification branches in the classification manager and name the branches similar to story names of the project and assign those classifications to the related elements of the building.

 

For instance, I will create a classification named "B5", then assign that classification to all the elements in basement 5 of the project. Eventually, by 

acu.FindClassificationItemInSystem() I can create lists that contains all the elements of each story, plus their story name.
 
do you think this a feasible and logical method? 

I'm assuming your intent is to just test out Python's capabilities. So yes, if the details are fleshed out, it would work. But if you are just interested in listing all elements on a story -- a schedule would be best and more logical

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

We have a python script that helps us organize and export schedule values to a spread sheet for our quantity take off purposes. Recently, we've decided to separate values also based on their home story name. Therefore, I'm trying to figure out what is the easiest way and requires the least amount of efforts from our engineers during modeling phase to access that information in python.


@Arash wrote:

. Therefore, I'm trying to figure out what is the easiest way and requires the least amount of efforts from our engineers during modeling phase to access that information in python.


As mentioned before ,Python does not have access to the Home Story property. Schedules do and , of course does the C++ API. Since you are already using Python to collect the properties that you need, I understand that you only want to include "Home Story". Good news is that ALL elements have a home story property, that's the way Archicad works. Since there is no direct access by Python, just use the indirect method-- as mentioned.

 

Create a expression in Property Manager, and make it available to all classifications. Set that classification root as one of the classes for all elements, then download that user created property (expression) with your other properties using Python. If you are unsure how to download properties in Python check out the Archicad Python web Site

Python Site 

You might want to make a request to Graphisift to include "Home Story" in the 26 release -- But that would be a year or two away.

Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 25

You could also use Properties for this instead of Classification. In fact, I would prefer using Properties to using Classifications for this specific purpose.

....................................................................................................
Laszlo Nagy, Lead Moderator, Community Admin
Get Archicad Tips at https://twitter.com/laszlonagy
AMD Ryzen 1700X CPU, 48 GB RAM, NVidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), WIN10 PRO ENG, AC20-AC25
Loving Archicad since 1995

Hello Laszlo,

 

Thank you very much for taking the time to read and answer my question. Could you please elaborate more on what you are suggesting? are you suggesting to enter "home story name" value of each element as a property during modeling phase? or is that that information is somehow stored somewhere in each element's property?

Arash, all I was trying to say was that for such a piece of information a Property would be better than creating new Classification entries. I believe Gerry gave you the possible options in his first answer. Unfortunately, I am not familiar with Python so I can not comment on that part, only on the part whether such info should be stored as a Property or as a Classification. (A Property is a single piece of info about an element, while a Classification determines which Properties will be available for an element, so the purposes of the two are different.)

....................................................................................................
Laszlo Nagy, Lead Moderator, Community Admin
Get Archicad Tips at https://twitter.com/laszlonagy
AMD Ryzen 1700X CPU, 48 GB RAM, NVidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), WIN10 PRO ENG, AC20-AC25
Loving Archicad since 1995

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!