Drawing of temporary objects

Drawing of temporary objects

fsztuczny
Advocate Advocate
695 Views
2 Replies
Message 1 of 3

Drawing of temporary objects

fsztuczny
Advocate
Advocate

Hello
I have a function in Editor.PointMonitor as below:

 

	private void monitor( object o, PointMonitorEventArgs e )
	{
	  ...
	  e.Context.DrawContext.Geometry.Draw( ent );
	}

 

The ent object does not have to be added to the Database. We can create various graphical elements without adding them to the drawing and draw them on the AutoCAD screen. For example:

 

using( Circle cir = new Circle( e.Context.ComputedPoint, Vector3d.ZAxis, radius ) )
{
  e.Context.DrawContext.Geometry.Draw( cir);
}

 


I would like to be able to draw elements without adding them to the drawing, outside of the Editor.PointMonitor action, using some method of the Editor, Viewport or Entity method. The Entity.Draw() method requires the Entity to be present in the Database.

These entities are created when the user uses a non-modal window. The non-modal window (its event) is supposed to force a refresh of the preview while waiting for a point in the Editor.

Any idea?

 

Regards.

0 Likes
696 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor

Sounds like you would use transient graphics. There are a lot of discussions on this topic. You can go to go to the famous blog "Through the Interface" and search "transient". It will give you quite a few very helpful articles on this topics that get you started on solid ground.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

fsztuczny
Advocate
Advocate

Not exactly. I didn't write this before, but while the non-modal window is taking focus, there is an Editor.PointMonitor mechanism running in AutoCAD while waiting for a point to be indicated. Changes resulting from actions in the non-modal window are only visible when AutoCAD regains focus (because only then PointMonitor is active). I would like to somehow force a refresh of temporary drawing elements when the focus is on the non-modal window.

 

0 Likes