The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Barry Kelly, Karl Ottenstein, LaszloNagy, ejrolon, gkmethy, Tibor Lorántfy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik

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
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.
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?
dibug error.JPG
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?

What else is there?
In particular, how do you find the distance of the four vertices of Polyline?
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.
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?
column element ID.JPG
column element ID.JPG (14.3 KiB) Viewed 1068 times