Select to view content in your preferred language

INewLineFeedback

2667
5
08-16-2010 01:55 AM
VictorAparicio
Emerging Contributor
Hi!

I have to develope a tool for drawing polylines in C# for ArcGis Engine and i´m using INewLineFeedback interface. I have no problem with the start and end point, but I don´t know how to use the MoveTo method correctly in the MouseMove Event.

This is my code:

            if (m_pNewLineFeedback != null)
            {
                IPoint pPoint = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
                m_pNewLineFeedback.MoveTo(pPoint);
            }

It draws a line when the mouse moves, but I don´t know how to remove the lines it draws before. Any ideas??

Thank you very much in advance!
0 Kudos
5 Replies
NeilClemmons
Honored Contributor
If you're setting your own symbol for the tool then you'll need to set the ROP2 property to NotXorPen.

symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen
0 Kudos
MatthewBuchanan
Occasional Contributor
Further to this question, I want to save the line feedback which I've stored in a module variable m_newlineFeedBack into a shapefile.

Can I do this?

   
Public Overrides Sub OnDblClick()
...snip...  
m_newLineFeedback.Stop()  
...snip...         
Dim feature As IFeature
feature = ftrClass.CreateFeature
feature.Shape = m_newlineFeedBack
m_newLineFeedback = Nothing
feature.Store()
0 Kudos
VictorAparicio
Emerging Contributor
If you're setting your own symbol for the tool then you'll need to set the ROP2 property to NotXorPen.

symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen


It works perfectly.

Thank you very much for your help!
0 Kudos
Venkata_RaoTammineni
Regular Contributor
Hi,
   You can save into shapefile..Please find the below attachment dll... You need to register that dll..and shapefile should be in editable mode...


Thanks and Regards

Venkat



Further to this question, I want to save the line feedback which I've stored in a module variable m_newlineFeedBack into a shapefile.

Can I do this?

   
Public Overrides Sub OnDblClick()
...snip...  
m_newLineFeedback.Stop()  
...snip...         
Dim feature As IFeature
feature = ftrClass.CreateFeature
feature.Shape = m_newlineFeedBack
m_newLineFeedback = Nothing
feature.Store()
0 Kudos
MatthewBuchanan
Occasional Contributor
Thanks Venkat
I was able to figure out how to do it in Visual Basic 2005. (some of the code is omitted)

Dim dataset As IDataset = fLayer.FeatureClass
dataset = fLayer.FeatureClass
Dim ftrClass As IFeatureClass = dataset
' Turn the new line feedback into a shape
Dim lineGeometry As IGeometry5
' Stop the feedback and put into geometry
lineGeometry = m_newLineFeedback.Stop
If Not lineGeometry Is Nothing Then
 '' Save the digitized line in the new shapefile
 Dim feature As IFeature
 feature = ftrClass.CreateFeature
 feature.Shape = lineGeometry
 feature.Store()
0 Kudos