Quantcast
Channel: ArchiCAD-Talk - Developer Forum
Viewing all 564 articles
Browse latest View live

Setting IFC Data to a Library Part

$
0
0
Author:gehairing
Posted: Fri Mar 11, 2016 11:22 am (GMT+1)


Hello the Forum Smile

In another post i have related my difficulty to get an API_Guid for a Library Part. My problem is not resolved but here i'll ask a question for the same subject in a different manner. Wink

I download a LibraryPart from a web server.
Once downloaded i set a serie of parameter in this library part. Each time the user place the LibPart object in the model, the instance has all the parameters i've added. That works fine.

I want also to set a serie of IFC parameters in this Library part. I don't know how to do this (because i can't get an API_Guid for the LibPart)

What i can do is :
- Download the LibPart,
- Wait until user places an instance of it in the model by using callback events and detect the right object,
- Apply the IFC data to the instance of the LibPart.

But this is not correct for me Wink
Because the next time the user will insert the same LibPart the IFC Data will not be attached to the new instance of the LibPart.

My question is : Is it possible to set IFC data in an Library Part with the API ?
(it is possible to do it in the user interface)


Setting IFC Data to a Library Part

$
0
0
Author:Ralph Wessel
Posted: Mon Mar 14, 2016 4:10 pm (GMT+1)


gehairing wrote:
My question is : Is it possible to set IFC data in an Library Part with the API ?

No, that isn't possible. IFC properties can be attached to instances of an object placed in the floor plan through the API, but not to the library part itself. Also, the library part unique ID is not a single guid like an element – it is more like a pair of guids for the part and it's versioning.

You can map IFC properties and values to elements or element data using ARCHICAD's IFC configuration, but I'm not sure an add-on could change that on the fly when new library parts are downloaded.
_________________
Ralph Wessel
Cadimage

Setting IFC Data to a Library Part

$
0
0
Author:gehairing
Posted: Mon Mar 14, 2016 4:26 pm (GMT+1)


Hi Ralph,

Again i have to thank you for your answer Cool
I am very happy that someone experienced like you gives answers here.
(Especially because nobody of the GS team gives answsers...i am waiting for a short answer to a few eMails i wrote...months ago Wink ).

It's a shame we cannot set the IFC Properties on the definition of the object. Especially because in the user interface we can do it.

So for the moment i do the trick i described in my previous message.

Setting IFC Data to a Library Part

$
0
0
Author:laszlonagy
Posted: Tue Mar 15, 2016 1:08 pm (GMT+1)


gehairing wrote:
(Especially because nobody of the GS team gives answers.


Because this is a User forum. User are giving answers to users. Users helping each other out.
Sometimes people from Graphisoft do chime in, but that is not to be expected. They are busy developing the best architectural BIM application for us.
Wink
_________________
Laszlo Nagy, Moderator, Site Admin
ASUS G73SW, i7-2630QM 16 GB RAM
17.3" (1920x1080), NVidia GTX 460M 1.5 GB RAM
60 GB SSD, 750 GB HDD, Win7-64 ENG
AC13-AC19 (64-bit, latest build)
Loving ArchiCAD since 1995

Setting IFC Data to a Library Part

$
0
0
Author:gehairing
Posted: Tue Mar 15, 2016 1:47 pm (GMT+1)


Hi Laszlo,

Yes, I can understand what you mean for the forum. It is better to let "users help users" in priority. But when you see posts with no answers for days/weeks i would find it smart that some of the dev team gives a quick answer from time to time. Of course, I don't speak only about my posts Wink

Anyway...i'll not change this Laughing

I do very few dev's with Archicad API. I work mostly for the Revit, 3DSMax, SKP and Rhino APIs where i have no problems because i am used to since years.

SaveAs .obj (or .treejs)

$
0
0
Author:Akos Somorjai
Posted: Fri Mar 18, 2016 6:39 pm (GMT+1)


Ralph Wessel wrote:
gehairing wrote:
I'm uploading some LibraryParts on a distant server and i want to add a 3D preview of the library part.

It depends on the required format for the data. You could temporarily place an instance of the library part in the project and extract its 3D geometry through ModelAccess or 3D Manager API. The temporary object can be deleted afterward. But then you would need to convert that data to the required output format.


Actually the Wavefront add-on exports its functionality through add-on communication (take a look at the Communication_Manager / Communication_Client examples in the the devkit).

The ID of the command is 'OBJO', its version is 1, and it expects a pointer to a correctly filled API_IOParams structure in the parameters. Just make sure you'll start your command from above the 3D Window with only your current object in it.

Best, Á kos

Visual Feedback in 3D view

$
0
0
Author:Akos Somorjai
Posted: Fri Mar 18, 2016 6:42 pm (GMT+1)


Xylios wrote:
Hello,

I have an addon that is creating a large number of elements, and I wanted to be able to view the elements being created in the 3D view.

My addon can be used while on the 3D view, but there is no elements being created. They only appear when the program finishes.

Anyone know how to view the creation of elements in ArchiCAD in the 3D view while the addon is working?

Update:

Found a solution, using ACAPI_Database(APIDb_RebuildCurrentDatabaseID)
after the creation of each element, the interface updates, showing the created elements.

Best Regards,
Xylios


The reason why that's happening is that you don't give any time to ARCHICAD when you create the elements. Calling rebuild regularly surely kills ARCHICAD's performance, so be careful with that. It's much better if you put up a progress window, that enables ARCHICAD to do some processing of the new elements.

Best, Á kos

Differentiate between Element Group and Hotlink Group?

$
0
0
Author:Akos Somorjai
Posted: Fri Mar 18, 2016 6:45 pm (GMT+1)


Erenford wrote:
How do you tell if the element is grouped by the user or is merely just inside a hotlink module? What I use is if there is a groupGuid value present although hotlinked elems also have a groupGuid and are being considered by ACAPI_ElementGroup_GetGroupedElems as a legit group even if they weren't grouped by the user and are just part of a hotlink.

Using ACAPI_ElementGroup_GetGroupedElems(groupGuid):
- Grouped elems (hotlinked or not) returns their immediate elems => this is what I need
- Non-grouped non-hotlinked elems have no groupGuid thus ignored => also ok
- Non-grouped hotlinked elems have a groupGuid and will return immediate elems (all fellow hotlinked elems) => not ok, I don't need this

Basically what I need are elements that are grouped only by the user regardless if its in a hotlink module or not, and any non-grouped elems (hotlinked and otherwise) should be ignored. Any Ideas?


Hotlinked elements also have the hotlinkGuid member set in their element header, whereas user-grouped elements don't.

Best, Á kos


Getting a API_Guid from Library part

$
0
0
Author:Akos Somorjai
Posted: Fri Mar 18, 2016 6:53 pm (GMT+1)


gehairing wrote:
I have made a test function.

The functions gets the selected element in the model and get his API_Guid.
It also tries to get the GUID from the library part (if an library part is selected of course).

When I compare the Guid's...there are different.
Probably i am not understanding how all this works.


Code:
   // Scan all selected objects in AC
   API_SelectionInfo selectionInfo;
   API_Neig **selNeigs;
   err = ACAPI_Selection_Get (&selectionInfo, &selNeigs, false);
   if (err == NoError)
   {
      // If we have selected elements
      if (selectionInfo.typeID != API_SelEmpty)
      {
         UInt32 ii, nSel;
         nSel = BMGetHandleSize ((GSHandle) selNeigs) / sizeof (API_Neig);
         for (ii = 0; ii < nSel && err == NoError; ii++)
         {
            // Get selected element
            API_Element  element;
            BNZeroMemory (&element, sizeof (API_Element));
            element.header.guid  = (*selNeigs)[ii].guid;
            err = ACAPI_Element_Get(&element);
            if(err == NoError)
            {
               // Is it a library part
               API_LibPart libpart;
               BNZeroMemory (&libpart, sizeof (libpart));
               libpart.index = element.object.libInd;
               err = ACAPI_LibPart_Get (&libpart);
               if (err == NoError)
               {
                  // Yes it's a library part

                  // Get elements guid
                  API_Guid good_ag = element.header.guid;
                     

                  
// Get Guids from the library part and NOT from selected element
                  GS::UniString s = libpart.ownUnID;
                  GS::Guid gs_guid(s);
                  API_Guid bad_ag  = GSGuid2APIGuid (gs_guid);

                  GS::UniString s1 = libpart.parentUnID;
                  GS::Guid gs_guid1(s1);
                  API_Guid bad_ag1  = GSGuid2APIGuid (gs_guid1);

                  DumpIFCProperties(libpart, good_ag);


Hi,

The major difference between library parts and objects in the ARCHICAD API domain is that library parts refer to gsm files (in the embedded library, in an other lcf (library container file)), whereas the objects are placed instances of library parts.

I reckon you already have the GUID you need without going indirectly to the library part. The (*selNeigs)[ii].guid contains the GUID of the element (object) placed onto the floor plan; you should get the actual values of the IFC properties from there. After ACAPI_Element_Get please also check if the element.header.typeID is of any of the libpart-based elements (API_ObjectID, API_LampID), otherwise the element.object.libInd doesn't contain valid information.

Best, Á kos

Start Edition

$
0
0
Author:Akos Somorjai
Posted: Fri Mar 18, 2016 6:55 pm (GMT+1)


stefan wrote:
Does the Devkit also support ArchiCAD Start Edition?

E.g. can an ArchiCAD 19 APX run on ArchiCAD Start Edition 2016 (based on 19)?

I assume that you have to take care not to use methods that call into non-supported functionality (e.g. Publisher, ...).


There isn't any restriction on the API, but restrictions inside ARCHICAD do apply; and yes, please do not call any unsupported function (though you should get an error code if you do that...)

Best, Á kos

Setting IFC Data to a Library Part

$
0
0
Author:Akos Somorjai
Posted: Fri Mar 18, 2016 7:00 pm (GMT+1)


gehairing wrote:
Hi Laszlo,

Yes, I can understand what you mean for the forum. It is better to let "users help users" in priority. But when you see posts with no answers for days/weeks i would find it smart that some of the dev team gives a quick answer from time to time. Of course, I don't speak only about my posts Wink

Anyway...i'll not change this Laughing

I do very few dev's with Archicad API. I work mostly for the Revit, 3DSMax, SKP and Rhino APIs where i have no problems because i am used to since years.


True, it's very hectic at the moment, and I'm sorry Embarassed . And kudos to Master Ralph for helping out Very Happy

BTW, I'm working on a new site where we can get most of the API developer communication into one channel, and also provide up-to-date documentation, tips&tricks and the like. So expect some news around the ARCHICAD 20 release... Smile

Á kos

convert xml and gsm

$
0
0
Author:Jiuzhu Zhang
Posted: Sun Mar 20, 2016 1:32 am (GMT+1)


Hi,

I met a problem when I used the LP_xml converter.exe.

When I click on the LP_xml converter.exe.It had a black window.But the

window fast disappeared(Flash back)and had not any error prompts.I couldn't

used the .exe file to convert xml and gsm file.

I want to know if I use the error way to open the LP_xml converter.exe.

I use the archicad 18.

Help me please.Thanks!By the way,I'm sorry for my poor english
Smile

How determine groups on next level from current group?

$
0
0
Author:Tsepov
Posted: Mon Mar 21, 2016 7:34 am (GMT+1)


API 19 Win.

Hello!
Help me please!)
I have this structure:

Group1 -> (Element1,Element2,Group2,...)
Group2 -> (Element3,..,GroupN)

I know guid of Group1.

How can I determine only next level groups from Group1?
Where I can give guid of Group2 from Group1?

Thank You!
_________________
ArchiCAD - The Best!!!

Getting a API_Guid from Library part

$
0
0
Author:gehairing
Posted: Mon Mar 21, 2016 8:26 am (GMT+1)


Thank you for the clarification Smile

Password Projected Object From API

$
0
0
Author:Ben Cohen
Posted: Wed Mar 23, 2016 8:46 am (GMT+1)


WOW. 2 years later I am doing a bit of API work and again I am trying to do this.
Thought I might do a search (I forgot I made this thread) - this was the only post that came up

Sad. Depressing
_________________
Ben Cohen

Mac and PC

Archicad (Latest Version) aus

www.4DLibrary.com.au


How determine groups on next level from current group?

$
0
0
Author:Tsepov
Posted: Wed Mar 23, 2016 3:44 pm (GMT+1)


It works:

GSErrCode ACAPI_ElementGroup_GetGroup (
API_Guid const& elemGuid
API_Guid* groupGuid
);

Instead elemGuid have to substitute the guid of the current group, then the function returns the guid of the group, the next level up.

It is obvious that function was conceived for this aim)). Embarassed
Thank you!)
_________________
ArchiCAD - The Best!!!

[SOLVED] Differentiate between Element and Hotlink Group?

$
0
0
Author:Erenford
Posted: Tue Mar 29, 2016 7:53 am (GMT+1)


Akos Somorjai wrote:

Hotlinked elements also have the hotlinkGuid member set in their element header, whereas user-grouped elements don't.

Best, Á kos


Yes, but what I'm having problems with is when it is BOTH grouped and hotlinked. For example:
1) Elems were user-grouped on its original project (lets say its P1)
2) On another project, P2, the project P1 is then hotlinked
3) On P2, elems will now have both valid hotlinkGuid and groupGuid in their headers.


Anyway, I've managed to get a workaround for this issue by comparing the number of levels of the group tree (using groupGuid and a while-looped ACAPI_ElementGroup_GetGroup) and the level number of the hotlink node (using hotlinkGuid and ACAPI_Database() APIDb_GetHotlinkRootNodeGuidID, APIDb_GetHotlinkNodeTreeID, etc).
If they're equal, then its a normal hotlinked elem. If group level is greater, means the elem is user-grouped (if the difference is 1 then it's user-grouped only once, greater than 1 means it's user-grouped multiple times).
_________________
Archicad 18 6101 INT FULL
Archicad 19 3003 INT FULL
Win 7 Pro SP 1 64-bit
Intel Core i5 CPU 750 @2.67GHz

New Publisher Set via API

$
0
0
Author:Bianca O
Posted: Thu Mar 31, 2016 1:00 am (GMT+1)


Hi.
I can't seem to find any example code or documentation on how to create a New Publisher Set and than add layout to the new publisher set

Rolling Eyes
_________________
------------------
Regards

Bianca Oliveira
ABN Group <www.abngroup.com.au>
PC user : API Development Kit 18

embed png picture to gsm

$
0
0
Author:Jiuzhu Zhang
Posted: Thu Apr 07, 2016 6:13 am (GMT+1)


Hi,

I embed the .png picture in the .gsm file by the LP_XMLConverter.exe.But

I met some problem.

The .png picture has a transparent background.when it was embeded in

the gsm.It was showed a color bolck.Not the image.What should I do for

this.Please help me.

Thanks!

Add-in Installer

$
0
0
Author:stefan
Posted: Thu Apr 14, 2016 9:55 am (GMT+1)


When we want to have an installer (Packager) for an Add-on, we don't know in advance where the Add-ons will have to be copied, as the user may have installed ArchiCAD more than once (e.g. INT and regional version) or in a custom location.

What is the correct way to determine this location?

E.g. on Windows > through a registry key?
And on Mac?

Or do we have to leave this free for the user to decide?
_________________
--- stefan boeykens --- architect-engineer-musician ---
ArchiCAD19+/Revit2015+/SketchUp2016/Cinema4D17/Rhino5/Unity5
rMBP15:i7Quad2.3Ghz+16GB+nVidia650M/ElCapitan+Win10

http://bit.ly/17u87df

Viewing all 564 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>