Kean Walmsley

July 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Twitter Updates

    follow me on Twitter



    « Accessing the AutoCAD objects referred to by fields using .NET | Main | Accessing DWG files not open in the AutoCAD editor using .NET »

    July 16, 2007

    TrackBack

    TrackBack URL for this entry:
    http://www.typepad.com/services/trackback/6a00d83452464869e200e00993d5288833

    Listed below are links to weblogs that reference Using a palette from .NET to display properties of multiple AutoCAD objects:

    Comments

    "Firstly, why bother? Well, the PaletteSet class is realy cool: it provides docking, auto-hide, transparency and fixes the annoying focus-related issues we see with normal modeless dialogs"

    Thanks for some good basic samples of using the PropertyGrid. In the future, you might want consider doing a bit more testing before presenting them.

    A bit more thorough testing in this particular case would have uncovered the significant problems that exist with AutoCAD's Palettes and .NET controls like the PropertyGrid.

    To see one major problem, place a PropertyGrid on a Palette and add it to a PaletteSet. Create the PaletteSet and show it. Dock the PaletteSet to any side of the AutoCAD window. Then, assign an object to the PropertyGrid's SelectedObject property, which has properties that use drop-down editing components (either drop-down combo boxes, or dropdown controls like the standard Color editor used by .NET for editing a color property).

    Then, with the PaletteSet docked, try to edit the properties of the assigned object(s) that use the aforementioned dropdown editors, and note what happens.

    I thought I'd mention this in the hope that your readers do not get the impression that using the PropertyGrid on a Palette is feasable, as it is not, or at least not until Autodesk figures out how to resolve the issues that can be seen by just following the above steps.

    It's great to publish samples of how to exploit the .NET framework and its wealth of functionality. But in cases like this (using the PropertyGrid on a Palette) where, practicle application is severely hampered and unfeasable because of show-stopping issues, those issues warrant mention and discussion in the context of even the most basic samples.

    Tony -

    There's no PropertyGrid in this sample, just a TextBox, so I don't see what "more thorough testing" I've failed to perform.

    I'm not aware of specific issues around the use of a PropertyGrid with a Palette, but it sounds like an interesting topic to cover at some point.

    Regards,

    Kean

    Any chance we could get this in VB.Net?

    It should be straightforward to recreate the project for VB.NET - the code can be translated using an online translator such as this one. The User Control can be recreated from scratch - just add one to your project and add a TextBox to it that is docked on all sides (you'll need to rename it typeTextBox, but that's all).

    I'd do it myself, but I'm busy working on the next post.

    Regards,

    Kean

    The code translator worked great. Thanks :)

    Hi Kean,
    Can we create property palette for a custom entity via wrapper in C#?

    Regards,
    Vignesh. S

    Hi Vignesh,

    The interface the property palette uses to access object properties is currently COM. You should be able to do this from C#, although I haven't tried it myself.

    Regards,

    Kean

    I'm making a palette in vb.net, but loading is very inconsistant, and i can't seem to get it to resize from code. sometimes it comes in all crazed and can't be resized, i've learned that this usually happens if i've already closed a drawing in that session of autocad. does anybody know a remedy for this situation? anybody else had this problem? it usually works just fine if i load my palette just after i start autocad, but i need it to be able to be loaded anytime for my other users. thanks for whatever help anybody can give on this, if you need me to post my code just let me know.

    Hi Tim,

    I'd suggest posting your question to the AutoCAD .NET Discussion Group.

    Regards,

    Kean

    This may be a dumb question, but how can one tell the name of the references that must be loaded? For example, what DLL's must I reference to get the code to work? In particular, I can't tell what to load to have CustomDialogs work.

    If this code is in the same project, there should be no need for references other than what's already in the code. At least I hope that's right - it's been a while since I posted this.

    Kean

    >>Isadore Garcia
    >>In particular, I can't tell what to load to >>have CustomDialogs work.

    With any luck you've already figured this out, but just in case...Don't feel bad, because I overlooked it at first, and I searched through the object browser and even a couple of additional .dll's and did not find CustomDialogs. Then I noticed CustomDialogs is the Namespace Kean created in the code. I'm guessing you left the Using (or Imports) statement in, but changed the namespace to something else.

    Hi again Kean,

    I just got around to attempting to impliment this, as a replacement for my modeless dialog, and it's wiggidy-wacked:(

    I had to hack up the sample pretty good, as I had a whole different need. Mostly, though, I just got rid of all the pointmonitor stuff as I don't need to react to anything. What happens is, when I first show the palette, it looks fine except I can't get it to show undocked, even though I added a line to set the Dock property to none.

    Then, while the palette is shown I am prompting the user for a selection, and if you manipulate the palette, the contents disappear, and my selection prompt gets canceled.

    If you let the thing show where it wants, and don't touch it, everything works fine, including when I update the text (my user control has 5 fixed labels, and 5 label controls I update with values). But if you touch the palette to move it, undock it, etc... it misbehaves badly.

    For now I have switched my code back to the modeless dialog, but I still see this as a valuable tool that I'd like to get figured out.

    It turns out it's not directly possible to set a palette to be floating on launch from .NET: you can do it using ObjectARX (C++) - and even have a small ObjectARX component in your application that does this for your .NET palettes - but I don't see a way to do it purely in .NET.

    As for the other problem... I don't see it in my sample, so there's not much I can do to help. Please submit it via ADN or the AutoCAD .NET Discussion Group.

    Kean

    Hi,
    Is there any work around to solve the problem of Property Grid DropDown controls inaccessibility when the PaletteSet is Docked.

    I faced the same problem, when adding the DevExpress Controls. but, i got a work around for that case by just keeping the focus of the PaletteSet to true (PaletteSet.KeepFocus = True). It solves the problem temporarily. Still it is just a work around.

    Even, the same workaround is not working for the PropertyGrid.

    I need your suggestion for this case.

    Thanks and Regards,
    Vignesh. S

    Vignesh,

    This post was not actually about using the PropertyGrid: I suggest that you submit your question via the ADN website as you work for an ADN member.

    Regards,

    Kean

    Thank you for your Suggestion.

    Regards,
    Vignesh. S

    Verify your Comment

    Previewing your Comment

    This is only a preview. Your comment has not yet been posted.

    Working...
    Your comment could not be posted. Error type:
    Your comment has been posted. Post another comment

    The letters and numbers you entered did not match the image. Please try again.

    As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

    Having trouble reading this image? View an alternate.

    Working...

    Post a comment

    Feed & Share

    Search