.NET

Reply
Active Contributor
dancalgary
Posts: 46
Registered: ‎05-18-2007
Message 1 of 5 (154 Views)

Acces info from an existing palette

154 Views, 4 Replies
08-20-2013 04:07 PM

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

 

 

 

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 5 (141 Views)

Re: Acces info from an existing palette

08-20-2013 05:34 PM 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

Developer Technical Services

Autodesk Developer Network


Active Contributor
dancalgary
Posts: 46
Registered: ‎05-18-2007
Message 3 of 5 (109 Views)

Re: Acces info from an existing palette

08-21-2013 07:25 AM 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.

*Expert Elite*
dgorsman
Posts: 5,372
Registered: ‎10-12-2006
Message 4 of 5 (97 Views)

Re: Acces info from an existing palette

08-21-2013 08:39 AM 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.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 5 of 5 (92 Views)

Re: Acces info from an existing palette

08-21-2013 08:54 AM 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

Developer Technical Services

Autodesk Developer Network


Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.