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.
SOLVED!

I want to adjust the window position. (in element_test)

LeeJaeYoung
Virtuoso

LeeJaeYoung_0-1688469301465.png

 

I am studying the window in element_test.
However, I understand the location, but I would like to know how to designate the 1. left and right direction of the window and 2. the inside/outside of the wall.


I'd be grateful if you could tell me where to look.
i am a beginner

 

typedef struct {
        API_Elem_Head                           head;
        API_OpeningBaseType                     openingBase;
        API_WindowDoorRevealDepthLocationID     revealDepthLocation;
        double                                  revealDepthOffset;
        double                                  revealDepthFromSide;
        double                                  jambDepthHead;
        double                                  jambDepthSill;
        double                                  jambDepth;
        double                                  jambDepth2;
        bool                                    reveal;
        bool                                    filler_1[7];
        API_Guid                                owner;
        double                                  objLoc;
        double                                  lower;
        API_Coord                               startPoint;
        API_Coord                               dirVector;
        API_WindowDoorDirectionTypes            directionType;
        short                                   fixPoint;
        short                                   filler_2;
    } API_WindowType, API_DoorType;
AC27 on window 11
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Check the following picture:

bschwb_1-1688903032085.png

 

Displayed are all 8 door orientation combinations for two different wall directions

And in the last row, you see how it would be if you'd draw the door manually.

Now we can deduce the following:

  1. Sun-icon (= outside) is on the right-hand side relative to the wall reference line. CORRESPONDS TO refSide = 0
  2. oside != refSide CORRESPONDS TO The door opens to the other side of the sun-icon. So it opens to the inside.
  3. oside == refSide CORRESPONDS TO The door opens to the side of the sun-icon. So it opens to the outside.
  4. reflected does not have an effect on whether the door opens to the inside or outside. It effects whether the door opens to the right or left when standing in front of it.

 

View solution in original post

11 REPLIES 11
LeeJaeYoung
Virtuoso

in AC25

LeeJaeYoung_1-1688470817519.png

In ac25, even though I changed the width from 900 to 1200, it does not work. But after resetting it, it's back to normal.
What's wrong?

After installing another window, this problem has changed to no problem.

 

in AC26 create window in element_test

LeeJaeYoung_0-1688470707218.png

 

AC27 on window 11
LeeJaeYoung
Virtuoso

I tried changing the revealDepthLocation, directionType, and fixPoint, but no response.

 

element.window.fixPoint = APIHoleAnchor_EndFix; seems to work.

What I thought is to make the point when I install the window be the right end point.

It seems to be installed and the bottom right corner is specified.

When specifying this, it seems that moving the insertion point by the width should also be considered.

 

 

 

I didn't do element.window.reveal = true;
I found that element.window.revealDepthLocation = APIWDRevealDepth_Core; did not work.

 

I'm still looking for the left and right and front and back positioning.
Please tell me at least where I should study

AC27 on window 11
LeeJaeYoung
Virtuoso

 

 

Question 1

startPoint

The location of the center point of the opening. It is measured from the beginning corner of the wall roof etc., rotated into the direction of the wall reference edge starting from the first corner.

Note that this location can be outside of the wall polygon.

 

LeeJaeYoung_1-1688478558787.png 

element.window.startPoint = begC;   or  element.window.startPoint.x = 1000;    element.window.startPoint.y = 1000;

 

No matter what number I put in, there was no change.
I can't pinpoint the exact meaning of this existence.
(objLoc is unused)

There was nothing wrong with using objLoc.

 

objLoc

Location of the center of the window. If the container wall is polygonal, this value is not used.

What I'm thinking of is entering the distance from the starting point.

 

 

AC27 on window 11
LeeJaeYoung
Virtuoso

question 2

 

revealDepthOffset
Inset from the clicked side of wall or core (according to revealDepthLocation).
revealDepthFromSide
Calculated inset from the clicked side of wall.

 

This phrase clearly says that it starts from the clicked side, but I can't.
The clicked value is c3 and obviously entered c2. But nowhere does it use c3 as an option.
c2 is element.window.objLoc = DistCPtr(&c2, &begC);
It just shows the distance.

if (!ClickAnElem("Click a wall to place a window", API_WallID, nullptr, &element.header.typeID, &wallGuid, &c3)) {
WriteReport_Alert("Please click a wall");
return;
}
I don't know how to use the value of c3 from this part.
I would be grateful if you let me know.

AC27 on window 11

Whether to use objLoc or startPoint depends on the type of wall the window/door is placed in.

  • Straight Walls: use objLoc. It measures the distance from the wall beginning point wallElement.wall.begC along the direction/reference line of the wall.
  • Curved Walls: use objLoc. It measures the distance from the wall beginning point wallElement.wall.begC along the CURVED reference line of the wall.
  • Poly Walls: use startPoint

thank you.^^

If possible, I would appreciate it if you could also tell me the answer to question number 2.

AC27 on window 11

Can't you adjust the front and back and left and right of the wall like installing windows in Archicad?

If you tell me it's possible, I'll look for more. ^^
We are waiting for your help. ^^

AC27 on window 11

Yes it's possible.
You'll need to change the following three options:

openingBase.reflected
openingBase.oSide
openingBase.refSide

All of them can be true or false. So there are 8 combinations.
They are a bit confusing and I always forget how it works, so it's best to just try all the combinations.


Also be aware of the wall reference line direction, it can have an impact too if I remember correctly.

Thank you for answer.
But here I have a question.
Usually when you set up a window, if you designate a line, it will be displayed on the outside or inside of the wall.
If so, how is this calculated?
Are you taking the information from the composite wall style and calculating whether it is external or internal?
How can you think outside or inside?

With your answer, I'm on a new path. thank you ^^

 

 

if (!ClickAnElem ("Click a wall to place a window", API_WallID, nullptr, &element.header.typeID, &wallGuid, &c3)) {
WriteReport_Alert ("Please click a wall");
return;
}
Can you determine element.window.openingBase.refSide = false or true with the point of c3?

AC27 on window 11