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?
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.
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).
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
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.
. 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
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.
You could also use Properties for this instead of Classification. In fact, I would prefer using Properties to using Classifications for this specific purpose.
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.)