License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

Auto-generation add-on for column CAD compatibility

Anonymous
Not applicable
I'm still an API beginner. I've been dealing with C ++ 10 years ago.
Area(or Zone) and text were created by inserting the precast columns and column name layers drawn in CAD drawings using merge to worksheet function.
I want to create an add-on that uses this and calculates the outline size of the area to create a column object and select the column Text nearest to each area as this object and input it as the id of the column object. Would it be easy to develop based on an example
24 REPLIES 24
Ralph Wessel
Mentor
Probably the most relevant example project is "Element_Test". This shows you have to create a new column, and how to find or edit existing elements.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Hi,

I had a similar idea once. When its ready are you going to publish this Addin?
Anonymous
Not applicable
We are reviewing the sample files. However, many results are written in a report window using a function called "WriterReport". Even if you run the add-on as a demo version and check the File / Information / Report menu,
How can I see the result?
For example, if you run Do_ListSelection (void) in the Selection example file, you do not know the result.
Ralph Wessel
Mentor
Debug into the add-on and set breakpoints wherever you want to inspect variable contents.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
To install Debugging tools, download Graphisoft Visual Studio debug visualizers as directed by the Tools for debugging site, copy GS.natvis, IO.natvis 2 files to the / Documents / Visual Studio 2015 / Visualizers folder and restart Visual Studio . And I loaded the apx example files that I built in the Archicad 21 add-on manager.
In Visual Studio, I set up breakpoints with F9 and started debugging by pressing F5
The following error occurs. What is the problem?
Anonymous
Not applicable
In Debugging in the Project Properties setting window, you specified the path of Archicad.exe to Command item, and Debug was able to execute. Thank you.
Anonymous
Not applicable
Here is the big execution flow for the addons I'm going to develop.

Using Archicad's Merge function, select the Column_layer and Column_Name_Layer layers in DWG to generate Polyline and Text.

1, Find a polyline quadrilateral element list with a specific layer.
2 Calculate the horizontal and vertical dimensions of the column by calculating the distance of the vertex of the polyline.
3, Get a list of Text with a specific layer, and get the base point and Text value.
4. Find the minimum distance between the diagonal intersection of the polyline and the text reference point.
5. Enter Text as the ID of the column element and enter the horizontal and vertical dimensions.
6. Create a column element.

What functions should be used when developing an execution function in this order?

ACAPI_Element_Get
ACAPI_Element_GetMemo
ACAPI_Element_GetDefaults
ACAPI_Element_Create
ACAPI_Element_ChangeParameters
..
What else is there?
In particular, how do you find the distance of the four vertices of Polyline?
Ralph Wessel
Mentor
You will probably want to use ACAPI_Element_GetElemList to find the 2d elements to construct the columns from.

I recommend also checking what 2D elements are created when the DWG is merged. Columns might be defined as any of the following:

- Four separate lines
- One to four polylines
- A combination of lines and polylines
- A fill (closed polygon)
- A library part (from an AutoCAD block), which might include the text label

The techniques for finding the elements and extracting relevant geometry will vary according to the element type. It's also possible there may be duplicates, e.g. a fill overlapping 4 bounding lines.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
I am considering how to create an Element.
If column_outLine_layer calculates the column dimension value (500mm * 500mm) with 2D polyline
           If column_name_layer is 2D text and the column element id (13-101-0100) is input

For API_ColumnType
coreDepth = vertical dimension
coreWidth = horizontal dimension
height = column height
origoPos.x =x coordinate of origin point
origoPos.y = y coordinate of origin point

To create an API_Element element
I created the API_ElementMemo element at the same time

We need to create a column element

Column Element id value (13-101-0100) Could not find the value of the variable in the structure where you can enter the character variable.
Can I enter the value of a column variable corresponding to the picture below in a variable value?