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



    « Using a modal .NET dialog to display AutoCAD object properties | Main | Applying a gradient fill to an AutoCAD hatch using .NET »

    June 29, 2007

    TrackBack

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

    Listed below are links to weblogs that reference Using a modeless .NET dialog to display AutoCAD object properties:

    Comments

    Thank you for the code sample, and I have a question?

    If you have for example, a polyline in the for of a slot when two of the sides have an arc, and you have other polylines that meet those sides and all around that slot to leave it as an island.

    Pointmonitor do not work and I have seen other cases where fail to select.

    Is there something we can do?

    I have tried to use this class before in one of my commands to select closed areas but not always was giving me the right one.

    Then, I end up making a selection of the closed polylines on the screen and using a function to select the polyline by defining an internal point, instead.

    Thanks!
    Luis.

    I have been using PointMonitor to display information about the entity via AppendToolTipText. It works great except for one thing: My drawing is mostly solids and if I hover over a solid so that it is highlighted, it will actually display the information of the solid that is behind the object that I'm trying to get the information for.

    How can I assure that I get the information for the object that is being highlighted?

    Luis -

    I'm afraid your description of the geometry isn't clear to me. Are you trying to detect when the cursor is hovering within a particular object? Unfortunately "pick in space" is not enabled when hovering over objects - the PointMonitor doesn't pick them up. Unless I've misunderstood...

    Tom -

    I'm not sure why this is happening. One thought is to make sure you're not picking the wrong item from the list (assuming there are more than one entity returned by the PointMonitor). I tried to reproduce the problem in my own code, but it seemed to work OK - a lot may depend on which visual style you're working with, etc.

    Regards,

    Kean

    Kean;

    Excuse my bad explanation :(

    Let see if I can explain better this time, by providing a short sample that can give you an idea:

    Draw an ellipse (with pellipse=1), then draw a rectangle to enclosure that ellipse in the center.

    Then, draw a line that divides the rectangle, can be drawn vertical or horizontal. Then use the command bpoly and generate two new closed polylines in the areas between the rectangle and the ellipse on the center.

    Erase, the original rectangle, and the line, and now call or use the pointmonitor, it won't select the ellipse, I know it can be brought up with draworder and later use the pointmonitor.

    The sample I provided it is very simple, but in the case I was thinking of using it it gets more complex, and the idea is have an easy selection, that's why I end up using a point inside the areas.

    Hope, you are not sleep when reading this last line.

    Thanks!

    Luis,

    I think the PointMonitor is working OK... check out the latest post in this series to see if the code in there helps.

    Regards,

    Kean

    Hi Kean,
    is it possible to have some examples of dockable modelss dialogs using .Net? (no palettes)
    thanks a lot in advance
    David

    Hi David,

    The parent of CAdUiPaletteSet (the internal MFC/ObjectARX class the PaletteSet wraps) is CAdUiDockControlBar, which is not exposed through the .NET API.

    So PaletteSet is currently the way to go for implementing a dockable modeless UI inside AutoCAD using .NET.

    Is there a particular reason you'd prefer not to use it?

    Regards,

    Kean

    Hi,
    1)loading
    2)calling "VT"
    3)terminating the dialogbox
    4)recalling "VT" --> Throws an Exception! (Can't access the object, Objectname: TypeViewerForm)
    Regards,
    David

    Hi David,

    It seems the form is betting disposed, and we then want to bring it up again. One option is to call this.Hide() in the closebutton handler, but we'd then have to set the dialog not to show the "X" button.

    The better option is probably to check for the availability of the form inside the VT command implementation, creating it again, as necessary:

    [CommandMethod("vt",CommandFlags.UsePickSet)]
    public void ViewType()
    {
    if (tvf == null || tvf.IsDisposed)
    tvf = new TypeViewerForm();
    Application.ShowModelessDialog(null, tvf, false);
    }

    Cheers,

    Kean

    Hi Kean, sorry if this is not relevant, but I would like to draw the AutoCAD objects like lines and circles on the dialog itself (or part of the dialog, a dialog item). Is this possible?
    Your help is greatly appreciated.
    Cheers, Nabil.

    Hi Nabil,

    If you need to display entities from a drawing or even temporary entities you add on the fly, you should look at the BlockView sample.

    Regards,

    Kean

    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