.NET

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

Acces info from an existing palette

128 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
Posts: 352
Registered: ‎07-24-2007
Message 2 of 5 (115 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
Posts: 46
Registered: ‎05-18-2007
Message 3 of 5 (83 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: 4,700
Registered: ‎10-12-2006
Message 4 of 5 (71 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
Posts: 352
Registered: ‎07-24-2007
Message 5 of 5 (66 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


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community