Author Topic: EditorUserInteraction  (Read 3626 times)

0 Members and 1 Guest are viewing this topic.

GUIDO ROOMS

  • Guest
EditorUserInteraction
« on: August 15, 2012, 06:00:16 AM »
Code - Visual Basic: [Select]
  1.         Dim Doc As Document = Application.DocumentManager.MdiActiveDocument
  2.         Dim Ed As Editor = Doc.Editor
  3.         Dim PointResult As PromptPointResult
  4.  
  5.         Using Interaction As EditorUserInteraction = Ed.StartUserInteraction(Me)
  6.             Try
  7.                 Ed.WriteMessage(vbLf & "Add points from drawing to coordinate file...")
  8.                 While True
  9.                     PointResult = Ed.GetPoint(vbLf & "Click a point")
  10.                     If PointResult.Status = PromptStatus.OK Then
  11.                         Ed.WriteMessage(vbLf & PointResult.Value.ToString)
  12.                     Else
  13.                         Exit While
  14.                     End If
  15.                 End While
  16.                 Interaction.End()
  17.             Catch ex As Exception
  18.                 Interaction.End()
  19.                 ShowError("Error while importing data from current document." & vbLf & ex.Message)
  20.             End Try
  21.         End Using
  22.  

Hi again,

When calling the above code from a modal dialog everything is fine, except that when the user executes
a transparent command like 'LAYER or when he clicks on the layer manager button (or other buttons) on the toolbar,
things go berserk.
From the magnificent documentation on EditorUserInteraction in ArxDoc I had inferred that a user
will only be allowed to select things. But my inference is wrong (again).
Anybody can throw some light on this? Thanks in advance.

TheMaster

  • Guest
Re: EditorUserInteraction
« Reply #1 on: August 15, 2012, 03:19:29 PM »
Code - Visual Basic: [Select]
  1.         Dim Doc As Document = Application.DocumentManager.MdiActiveDocument
  2.         Dim Ed As Editor = Doc.Editor
  3.         Dim PointResult As PromptPointResult
  4.  
  5.         Using Interaction As EditorUserInteraction = Ed.StartUserInteraction(Me)
  6.             Try
  7.                 Ed.WriteMessage(vbLf & "Add points from drawing to coordinate file...")
  8.                 While True
  9.                     PointResult = Ed.GetPoint(vbLf & "Click a point")
  10.                     If PointResult.Status = PromptStatus.OK Then
  11.                         Ed.WriteMessage(vbLf & PointResult.Value.ToString)
  12.                     Else
  13.                         Exit While
  14.                     End If
  15.                 End While
  16.                 Interaction.End()
  17.             Catch ex As Exception
  18.                 Interaction.End()
  19.                 ShowError("Error while importing data from current document." & vbLf & ex.Message)
  20.             End Try
  21.         End Using
  22.  

Hi again,

When calling the above code from a modal dialog everything is fine, except that when the user executes
a transparent command like 'LAYER or when he clicks on the layer manager button (or other buttons) on the toolbar,
things go berserk.
From the magnificent documentation on EditorUserInteraction in ArxDoc I had inferred that a user
will only be allowed to select things. But my inference is wrong (again).
Anybody can throw some light on this? Thanks in advance.

My guess (and that's all it is), is that this may happen because the layer manager was butchered to support the Action Recorder. To make what you do in dialogs 'recordable', everything they do is done via executing AutoCAD commands, which can easily interfere with a runnig application when they're used transparently.

GUIDO ROOMS

  • Guest
Re: EditorUserInteraction
« Reply #2 on: August 15, 2012, 03:55:08 PM »
Thanks for the reply.
Sometimes it feels a bit like taming an elephant on speed.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: EditorUserInteraction
« Reply #3 on: August 16, 2012, 08:52:57 PM »

Perhaps have a look at either of these by Doug Goforth
.NET Command School, VB Edition
http://au.autodesk.com/?nd=class&session_id=5289

.NET Command School C# Edition
http://au.autodesk.com/?nd=class&session_id=5292
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8718
  • AKA Daniel
Re: EditorUserInteraction
« Reply #4 on: August 16, 2012, 09:47:26 PM »
...it feels a bit like taming an elephant on speed....

I know exactly how that feels

GUIDO ROOMS

  • Guest
Re: EditorUserInteraction
« Reply #5 on: August 17, 2012, 10:31:29 AM »
Hey Daniel,
In some recent posts here, there's been talk about AutoCAD alternatives.
You seem to be quite familiar with BricsCAD. How about BricsCAD and .NET, is that a possibility?
I know they were working on that, do you happen to know how things stand?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8718
  • AKA Daniel
Re: EditorUserInteraction
« Reply #6 on: August 20, 2012, 09:08:33 AM »
Hey Daniel,
In some recent posts here, there's been talk about AutoCAD alternatives.
You seem to be quite familiar with BricsCAD. How about BricsCAD and .NET, is that a possibility?
I know they were working on that, do you happen to know how things stand?

Yeah, Bricscad's .NET API is coming along very nicely 8-)  There are a few things not yet implemented, but it's quite usable now.  Get the demo and give it a whirl  :-)