.NET

Reply
wkt
Member
wkt
Posts: 5
Registered: ‎05-22-2012
Message 1 of 5 (555 Views)
Accepted Solution

How to add Paletteset for AutoCAD 2013 c#

555 Views, 4 Replies
07-17-2013 06:00 PM
I cant find Autodesk.AutoCAD.Windows.PaletteSet as My Program,

im import AutoCAD 2013 x64 Directorys
accoremgd.dll
acdbmgd.dll
as my source.

Program is using c# 4.0

Please help me.

   // this is my class source.

   using ACAD = Autodesk.AutoCAD.ApplicationServices.Core;
   using Autodesk.AutoCAD.Runtime;





Valued Contributor
amanero
Posts: 71
Registered: ‎12-03-2003
Message 2 of 5 (531 Views)

Re: How to add Paletteset for AutoCAD 2013 c#

07-18-2013 12:00 AM in reply to: wkt

Did you add the "AcMgd" reference?

Luis Alberto Manero, Geograma.com
wkt
Member
wkt
Posts: 5
Registered: ‎05-22-2012
Message 3 of 5 (514 Views)

Re: How to add Paletteset for AutoCAD 2013 c#

07-18-2013 06:14 AM in reply to: amanero

Thank you:smileywink:

Member
mchan01
Posts: 4
Registered: ‎01-08-2014
Message 4 of 5 (298 Views)

Re: How to add Paletteset for AutoCAD 2013 c#

02-25-2014 03:13 PM in reply to: wkt

Is it possible to add a usercontrol on the paletteset on runtime?

My scenario is i already have a blank palette and i would to place a button inside and as soon as i click the button, i want to add an instance of my usercontrol..

 

the button will act like a menu button or some add button.

 

Thanks

*Expert Elite*
norman.yuan
Posts: 961
Registered: ‎04-27-2009
Message 5 of 5 (270 Views)

Re: How to add Paletteset for AutoCAD 2013 c#

02-27-2014 06:45 AM in reply to: mchan01

Firstly, your question is not much relevant to the original post, which has already accepted a solution. Appending your irrelevant question in this thread may result in lower attention and fewer replies. You'd better post in a new thread, and add link to other posts if you think they coul be somehow related.

 

To your question:

 

Palette itself is a UserControl (if you add a custom System.Windows.Forms.UserControl into PaletteSet), and yes, you can add Windows.Forms.Control (including UserControl) dynamically at runtime into another Control, if it is a Control container, such as UserControl, Form...

 

The code would be like:

 

public class MyPalette:UserControl

{

    ...

    private void Button1_Click(....)

    {

        //Add a textbox

        TextBox txt=new TextBox()

        txt.Name="TextBox1";

        txt.Text="This is new text box";

        txt.Location=new Point(5,5);

        txt.Size=new Size(20,100);

        this.Controls.Add(txt)

 

        //Add something else

    }

}

 

Although you can add controls to a control container at runtime, it does not mean it always worth doing it: it is difficult to maintain the code, debuging is a pain.

 

One alternative way is to add all controls at design time and turn their visibility on/off, or enable/disable them accordingly.

 

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
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

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

Ask the Community