.NET

.NET

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

Acces info from an existing palette

163 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 (150 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 (118 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,698
Registered: ‎10-12-2006
Message 4 of 5 (106 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 (101 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


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.