cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Issue with Column Rotation in Code

sijocherian
Contributor

Hi team

I am reaching out regarding an issue I encountered while attempting to rotate a column by its own axis using code.

I have utilized the following code snippet:

 

	element.column.head.floorInd = short(storey);

	element.column.origoPos = beg;
	element.column.coreAnchor = 6;

	element.column.relativeTopStory = 0;
	element.column.height = height;
	element.column.bottomOffset = baseOffset;
	element.column.isSlanted = true;
	memo.columnSegments[0].assemblySegmentData.isWidthAndHeightLinked = false;
	memo.columnSegments[0].assemblySegmentData.nominalWidth = width;
	memo.columnSegments[0].assemblySegmentData.nominalHeight = breadth;
	element.column.axisRotationAngle = 0.785398;

	err = ACAPI_Element_Create(&element, &memo);

 

 

Despite setting the axisRotationAngle to 0.785398 (which corresponds to 45 degrees), I am not observing any rotation of the column upon rendering.

However, I can achieve the desired rotation angle through the user interface.

 

sijocherian_0-1710918785195.png

 

sijocherian_1-1710918830138.png

 

Could you please advise if there is anything I might be missing or if there is an alternative approach to achieve the desired rotation angle programmatically?

Thank you very much for your assistance

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
LChen
Graphisoft
Graphisoft

Hi,

The axisRotationAngle should works in latest version (AC27.2.0). If you still meet the problem please try the following code (I just added two lines as first):

 

    element.header.type = API_ColumnID;
    GSErrCode err = ACAPI_Element_GetDefaults (&element, &memo);

    element.column.head.floorInd = short(storey);

    element.column.origoPos = beg;
    element.column.coreAnchor = 6;

    element.column.relativeTopStory = 0;
    element.column.height = height;
    element.column.bottomOffset = baseOffset;
    element.column.isSlanted = true;
    memo.columnSegments[0].assemblySegmentData.isWidthAndHeightLinked = false;
    memo.columnSegments[0].assemblySegmentData.nominalWidth = width;
    memo.columnSegments[0].assemblySegmentData.nominalHeight = breadth;
    element.column.axisRotationAngle = 0.785398;

    err = ACAPI_Element_Create(&element, &memo);

View solution in original post

1 REPLY 1
Solution
LChen
Graphisoft
Graphisoft

Hi,

The axisRotationAngle should works in latest version (AC27.2.0). If you still meet the problem please try the following code (I just added two lines as first):

 

    element.header.type = API_ColumnID;
    GSErrCode err = ACAPI_Element_GetDefaults (&element, &memo);

    element.column.head.floorInd = short(storey);

    element.column.origoPos = beg;
    element.column.coreAnchor = 6;

    element.column.relativeTopStory = 0;
    element.column.height = height;
    element.column.bottomOffset = baseOffset;
    element.column.isSlanted = true;
    memo.columnSegments[0].assemblySegmentData.isWidthAndHeightLinked = false;
    memo.columnSegments[0].assemblySegmentData.nominalWidth = width;
    memo.columnSegments[0].assemblySegmentData.nominalHeight = breadth;
    element.column.axisRotationAngle = 0.785398;

    err = ACAPI_Element_Create(&element, &memo);