I want to run a code something like this:
for each ctrl in autocad window
if type of ctrl is palette then
Practically I want to read the info existing from a palette that is loaded by CADWORX
i don't think there is a way to iterate *all* palette windows in AutoCAD using .NET. The only way that might be possible is to use MFC to iterate the CControlbar objects... Something like this:
// loop through the control bars, loop 1000
for (UINTcount=0; count<1000; ++count)
CControlBar *controlBar = acedGetAcadFrame()->GetControlBar(count);
if (controlBar == NULL)
// convert from ControlBar to CAdUiPaletteSet
CAdUiPaletteSet *dockControlBar = DYNAMIC_DOWNCAST(CAdUiPaletteSet, controlBar);
// if ok
if (dockControlBar != NULL)
thanks for the answer
mfc looks is the way but unfortunatelly for me i do not know how to implement it.
i was trying to read the text from a combobox on that palette and i don't know what is the name of that palette that is brought in by Cadworx.
My advice, read the PRJ content directly using something from System.XML namespace.
Once you have found the PaletteSet window, you can enumerate the controls to find the CCombobox. Use the EnumChildWindows() in the Win32 SDK
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register