How To Add Top Tool In AutoCAD

How To Add Top Tool In AutoCAD

scgq425
Advocate Advocate
477 Views
4 Replies
Message 1 of 5

How To Add Top Tool In AutoCAD

scgq425
Advocate
Advocate

I use AutoCAD 2016 , and want to add a tool in picture location . 1. use PaletteSet , but when i dock top , this minHeight will bigger then i want so 

has other interface or issues to show this?

scgq425_0-1732779929559.png

    if (PSet == null || PSet.Visible == false)
    {
        var window = new PatternSetWindow();

        PSet = new PaletteSet("TYDI_Document");
        PSet.Visible = true;
        ElementHost host = new()
        {
            AutoSize = true,
            Dock = DockStyle.Fill,
            Child = window
        };
        
        PSet.Style =  PaletteSetStyles.ShowCloseButton | PaletteSetStyles.ShowAutoHideButton  | PaletteSetStyles.ShowPropertiesMenu | PaletteSetStyles.Notify ;
        PSet.Add("TYDI_Document", host);
        PSet.KeepFocus = true;
        PSet.Size = new Size(1200, 30);
        PSet.MinimumSize = new Size(1200, 3);
        PSet.Dock = DockSides.Top;
        PSet.DockEnabled = DockSides.Top;
        //PSet.WindowState = Window.State.Minimized;
        PSet.RecalculateDockSiteLayout();
    }
}

LanHui Xu 徐兰辉
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog
LinkedIn
Revit/CAD Development | Steel Product Manager

EESignature

0 Likes
478 Views
4 Replies
Replies (4)
Message 2 of 5

norman.yuan
Mentor
Mentor

Why do you want to use PaletteSet docked on top, instead of standard menu system (Ribbon, namely). You can create your own partial menu using command CUI and distribute/deploy it with your app/plugin together, which can be easily edited/updated. If you really want a dynamically created menu items with code, you can code your own Ribbon tab/panel/items... and load it with your plugin. If you really want to use PaletteSet that looks/works like ToolPaletteSet, then do not expect it can be docked like toolbar.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 5

scgq425
Advocate
Advocate

Hi @norman.yuan :

i try to use the toolbar to set commands , but designer  want change the button image to text , like : "text align"

in paletteSet , is real- minValues is more than 100 piexls , even set the `MinimumSize` like : 30 

also im try to show only text with cui or mns , but is failed , also has button , do you has the similar example or issue?

 

thanks.

 

LanHui Xu 徐兰辉
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog
LinkedIn
Revit/CAD Development | Steel Product Manager

EESignature

0 Likes
Message 4 of 5

norman.yuan
Mentor
Mentor

Why not use ribbon button in Ribbon menu. which can have text caption with or without image?

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 5

scgq425
Advocate
Advocate

Hi @norman.yuan :

in objectarx , i  use the  cAcuiDialog to show this style .

i want to get the same style use c# , beacuse the document web api and other servers api use c# will easy to connect , but try to use toolbar or PaletteSet that cant support .

scgq425_0-1732952304518.png

 

LanHui Xu 徐兰辉
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog
LinkedIn
Revit/CAD Development | Steel Product Manager

EESignature

0 Likes