Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Newbie - Paletteset

2 REPLIES 2
Reply
Message 1 of 3
JFN_KSH
536 Views, 2 Replies

Newbie - Paletteset

I'm trying to follow the DevTV_AutoCAD_NET_Training_Session_4 which shows how to create a toolpalette. I created a Usercontrol like shown. I wrote some dimension style coding I would like to use in the toolpalette. I'm having some issues with the PaletteSet.Add Method (string, Control). Intellisense return an error saying "Value of type 'Dimension_Styles.UserControl1' cannot be converted to 'System.Uri'". I'm lost, don't know what to do or to look for... 

 

In the ObjectARX Reference guide for PaletteSet.Add Method it say;
Public Function Add(

'Input palette name
    name As string, 

'Input palette control 
    control As Control

) As Palette

 What should be the palette's name?

What should be the control?

 

here's my code below;

Public Class DimStylePalette
    Public myPaletteSet As PaletteSet
    Public myPalette As UserControl1
    <CommandMethod("palette")> _
    Public Sub palette()
        If (myPaletteSet = Nothing) Then
            myPaletteSet = New PaletteSet("My Palette", New Guid("33EB0D00-1036-439B-8B27-A11BA4669211"))
            myPalette = New UserControl1
            myPaletteSet.Add("My Palette", myPalette)
        End If

        myPaletteSet.Style = PaletteSetStyles.ShowPropertiesMenu Or _
            PaletteSetStyles.ShowAutoHideButton Or _
            PaletteSetStyles.ShowCloseButton

        myPaletteSet.Visible = True
    End Sub
End Class

 I'm new to vb.net &, coming from LISP, I have to say it's hard to come around...

 Any help would be greatly appreciated...

Thanks!

 

2 REPLIES 2
Message 2 of 3
_gile
in reply to: JFN_KSH

Hi,

 

I replied your post at TheSwamp.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3
augusto.goncalves
in reply to: JFN_KSH

Also, if the usercontrol is a Windows Form Control, indeed use PaletteSet.Add, if is a WPF control, please use PaletteSet.AddVisual
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report