Searching: Drawing Area in ACAD/BricsCAD

Started by Ingo P, October 16, 2012, 04:41:14 AM

Previous topic - Next topic

Ingo P

Hi

I am working on a replacement for the AutoCAD screenmenu that would run in BricsCAD and later ACAD-Versions that no longer contain the original screenmenu.

Most functions are working fine - I already have replacements for grtext and menucmd, that work according to the used environment (original screenmenu or my screenmenu) but I am having difficulties with the position of the menu.

It is a non-modular dialog that is shown when called and hidden, when not needed.

Getting the position and size of the main application window is no problem thanks to the code block
Code (autolisp) Select
(SETQ app (VLAX-GET-ACAD-OBJECT)
      w   (VLA-GET-WIDTH app)
      h   (VLA-GET-HEIGHT app)
      x   (VLA-GET-WINDOWLEFT app)
      y   (VLA-GET-WINDOWTOP app)
      )

(thanks Slavko Ivanovic (http://www.opendcl.com/forum/index.php?topic=952.msg4779#msg4779))

My problem right now is that I would like to place the menu on the same side as the Promptmenu in bricsCAD (
Code (autolisp) Select
(getvar "promptmenu") ) or left, if this can not be determined.
I can however not find a way to get the maximum drawing area of the current application window (the area a drawing is shown, if it is maximized). This area would be limited by some factors like number of toolboxes on the top, height of the console screen, docked palettes left an right an all the other things around the drawing area.

Does anyone have an idea of how to get these values?

Kind regards

IP

owenwengerd

Have you considered making your form a dockable control bar instead? Control bars already include the positioning and docking logic that you're trying to implement.
Owen Wengerd (Outside The Box) / ManuSoft

Ingo P

The first try was a dockable dialog, but that was trashed and the non-modal dialog was created so that the new menu's look would be more like BricsCAD's initget menu.
That means the dialog should not really dock to a border (that would make the drawing flicker when activating/deactivating the dialog) but instead should stick to the top/left or top/right of the drawing. That way the screen would not be to full in BricsCAD, but the menu would be there when it is needed.

I am currently browsing through the many not to well documented vla- functions in hopes to find a solution.
if nothing else helps I will have to go back to a dockable dialog or need to build a DLL, that will implement the needed data through the .NET interfaces, but that is a way I don't want really want to go, since I would have to build the DLL for all AutoCAD und BricsCAD Verions. A clean solution in LISP would make this menu a easy maintainable Fire-And-Forget application that could be made public without much work in the future.

owenwengerd

There are still numerous problems with Palette forms in Bricscad, but maybe the palette behavior would be more to your liking. Unfortunately I don't know of any way to get the document window position via lisp.
Owen Wengerd (Outside The Box) / ManuSoft