Accessing properties & attributes of an element
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-18
10:03 PM
- last edited on
2023-08-02
03:20 PM
by
Doreena Deng
So, for example, for a door, I can see it has an ID, it has a setting that says whether its load bearing, external etc. I can also see that there are Materials and other parameters associated with the door.
How do I get at these via API. I tried listing the parameters and it always tells me the parameter count is 0.
- Labels:
-
Add-On (C++)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-22 12:53 PM
LesWoolsey wrote:I assume you want the parameters derived from the GDL door object? If so, you need to look in a memo structure linked to the element. This data is not automatically loaded with the rest of the element for efficiency, so it has to be loaded independently. There are 2 ways to approach this:
I can see it has an ID, it has a setting that says whether its load bearing, external etc. I can also see that there are Materials and other parameters associated with the door. How do I get at these via API. I tried listing the parameters and it always tells me the parameter count is 0.
- 1. The easiest method is
APIAny_OpenParametersID(and related functions). Refer to the documentation for more information.
2. The former approach may not be flexible enough - if so, take a look at theAPI_ElementMemostructure (specifically the paramsfield) and the function that retrieves the data, ACAPI_Element_GetMemo.
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-22 06:42 PM
API_ElementMemo memo;
if (element.header.hasMemo) {
err = ACAPI_Element_GetMemo(element.header.guid, &memo);
if (err == NoError) {
the memo object has a value for param called "A". But where are the rest of the parameters?
I did try the APIAny_OpenParametersID and APIAny_GetActParametersID functions following the example code and I just got the same result. There didn't seem to be a way to get a parameter count, parameter list or parameter array anywhere.
I'm clearly missing something pretty obvious but I can't see what based on the documentation & examples.
I'll continue digging to but any suggestions would be appreciated.
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-22 09:46 PM
LesWoolsey wrote:The 'A' parameter is simply the first item in the array, i.e.
the memo object has a value for param called "A". But where are the rest of the parameters?
(*memo.params)[0]The 'B' parameter would be:
(*memo.params)[1]...and so on. You could get the total number of parameters by dividing the memory allocation by the size of the parameter structure:
UInt32 totalParams = BMGetHandleSize(memo.params) / sizeof(API_AddParType);
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-23 05:23 PM
My goal is to be able to see the various properties that get exposed in the IFC file and be able to view (and in some cases change them). So I'm trying to relate standard property names (eg from PSET_DOORCOMMON]) back to the definition in the model.
Am I looking in the wrong place to find this, or am I missing something obvious. I have to admit that doing this as a plug-in for Revit was pretty straight forward.
Your advice/suggestoins are appreciated.
[/img]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-23 06:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-23 11:59 PM
LesWoolsey wrote:The data is stored in different locations - some it is in the element, some in the parameters, and some in the IFC properties/attributes. And yes, the new functions in AC16 will allow you to extract the IFC properties. However, the IFC properties may not relate to anything you see in the model, e.g. the materials of a door. Objects cannot use (or even see) IFC properties, so materials will largely be driven by parameters.
it doesn't seem to relate in any obvious way to the building. For example, if I select a door and check its selection properties, I get a whole lot of properties, For example, under Tags & Categories & I can see, ID, Structural Function, Position etc. But I don't see any of that in the list I get back in the memo params. I also don't get back the door's type. I can't see where the various materials and finished are defined. My goal is to be able to see the various properties that get exposed in the IFC file
Could you describe the functionality you are aiming to develop at a higher level? It might be easier to suggest a way forward.
Central Innovation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-24 12:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-04-24 02:20 PM
LesWoolsey wrote:Sure, I'll contact you by email. The best starting point from this forum is PM first - then you don't need to expose your email address. Spammers trawl these forums for target addresses unfortunately.
Is there a way to communicate off the message board?
Central Innovation