Window height and width problem
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2016-04-14
07:13 PM
- last edited on
ā2023-07-12
09:09 PM
by
Doreena Deng
ā2016-04-14
07:13 PM
Hello there,
I was trying to alter the width and height of a window using the corresponding parameters width and height of API_OpeningBaseType that each window/door/skylight elements have, and noticed that the window didn't updated its height or width.
For the changes to effect on the window it required me to open the window options and click OK so the changes take effect.
As a work-around, and to simulate the update, I thought of after creating the window calling Element_Change, without actually changing anything, but 'forcing' an update to the window, and it worked. The changes to width and height of the window were visible on the window.
However, this function (ACAPI_Element_Change), as stated in the documentation only works on specific databases, "The current database should be the floor plan, a section/elevation, a detail or a worksheet". Alas, when I tried to create a window in a 3D view it gave me the corresponding error APIERR_BADDATABASE.
Due to this, I was wondering two things:
First, there is a way of correctly modifying the window's width and height without the need to call ACAPI_Element_Change.
And second, if there is an operation that allows me to go from the 3DView to a story view. I tried using ACAPI_Environment(APIEnv_ChangeStorySettingsID, ...) with the command to change story, APIStory_GoTo, but it only worked when my view is already in a story (for example, when I change from story 1 to story 0), and it does not work when going from 3Dview to story.
Thanks in advance,
Xylios
I was trying to alter the width and height of a window using the corresponding parameters width and height of API_OpeningBaseType that each window/door/skylight elements have, and noticed that the window didn't updated its height or width.
For the changes to effect on the window it required me to open the window options and click OK so the changes take effect.
As a work-around, and to simulate the update, I thought of after creating the window calling Element_Change, without actually changing anything, but 'forcing' an update to the window, and it worked. The changes to width and height of the window were visible on the window.
However, this function (ACAPI_Element_Change), as stated in the documentation only works on specific databases, "The current database should be the floor plan, a section/elevation, a detail or a worksheet". Alas, when I tried to create a window in a 3D view it gave me the corresponding error APIERR_BADDATABASE.
Due to this, I was wondering two things:
First, there is a way of correctly modifying the window's width and height without the need to call ACAPI_Element_Change.
And second, if there is an operation that allows me to go from the 3DView to a story view. I tried using ACAPI_Environment(APIEnv_ChangeStorySettingsID, ...) with the command to change story, APIStory_GoTo, but it only worked when my view is already in a story (for example, when I change from story 1 to story 0), and it does not work when going from 3Dview to story.
Thanks in advance,
Xylios
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2016-04-15 04:57 PM
ā2016-04-15
04:57 PM
Look at:
APIDb_GetCurrentDatabaseID
APIDb_ChangeCurrentDatabaseID
APIDo_ChangeWindowID
Usual steps, if current database is not floor plan:
APIDb_GetCurrentDatabaseID
APIDb_ChangeCurrentDatabaseID
APIDo_ChangeWindowID
Usual steps, if current database is not floor plan:
- Keep current database ( APIDb_GetCurrentDatabaseID )
Set floor plan database (ChangeCurrentDatabaseID )
Do floor plan updates ( like ACAPI_Element_Change )
Restore keeped database (ChangeCurrentDatabaseID )
- Activate floor plan window (APIDo_ChangeWindowID)
Go to story (APIStory_GoTo)
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2016-04-15 08:01 PM
ā2016-04-15
08:01 PM
Hello,
I tried following your advice and it works!
Thank you for the reply,
Xylios
I tried following your advice and it works!
Thank you for the reply,
Xylios