.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Acces info from an existing palette

4 REPLIES 4
Reply
Message 1 of 5
dancalgary
351 Views, 4 Replies

Acces info from an existing palette

I want to run a code something like this:

for each ctrl in autocad window

if type of ctrl is palette then

msgbox (Ctrl.name)

end if

next

 

Practically I want to read the info existing from a palette that is loaded by CADWORX

 

Thanks

 

 

 

4 REPLIES 4
Message 2 of 5
fenton.webb
in reply to: dancalgary

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)

  continue;

// convert from ControlBar to CAdUiPaletteSet

CAdUiPaletteSet *dockControlBar = DYNAMIC_DOWNCAST(CAdUiPaletteSet, controlBar);

// if ok

if (dockControlBar != NULL)

{

 do something

}




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 5
dancalgary
in reply to: fenton.webb

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.

Message 4 of 5
dgorsman
in reply to: dancalgary

My advice, read the PRJ content directly using something from System.XML namespace.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 5 of 5
fenton.webb
in reply to: dgorsman

Once you have found the PaletteSet window, you can enumerate the controls to find the CCombobox. Use the EnumChildWindows() in the Win32 SDK

 

 




Fenton Webb
AutoCAD Engineering
Autodesk

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost