.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to clear line made by Editor.DrawVector()

3 REPLIES 3
Reply
Message 1 of 4
gangzaishao
1055 Views, 3 Replies

How to clear line made by Editor.DrawVector()

to clear lines made by Editor.DrawVector()
I 'v tried to Use Editor.UpdateScreen() but is no effective!!
Can anyone tell me? thanks
3 REPLIES 3
Message 2 of 4
gangzaishao
in reply to: gangzaishao


{code}
#define ACADR17
using System;
using System.Collections.Generic;
using System.Text;
//
using System.Runtime.InteropServices;
//
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using AcadException = Autodesk.AutoCAD.Runtime.Exception;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
//
namespace StrassenCAD
{
public static class GZSTool
{
//
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
private static extern Int32 acedRedraw(long [] name, Int32 mode);
#if ACADR16
[DllImport("acdb16.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="?acdbGetAdsName@@YA?AW4ErrorStatus@Acad@@AAY01JVAcDbObjectId@@@Z")]
#elif ACADR17
[DllImport("acdb17.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="?acdbGetAdsName@@YA?AW4ErrorStatus@Acad@@AAY01JVAcDbObjectId@@@Z")]
#endif
private static extern int acdbGetAdsName(long[] name, ObjectId objId);
//
public static void ReDraw()
{
acedRedraw(null,1);
}
}
}
{code}
Message 3 of 4

Use regen

Message 4 of 4
StormyC
in reply to: gangzaishao

I think you need to use this to get the document to redraw - regen takes a long time on large drawings so I use this method in one of my routines.

 

Using lock As DocumentLock = acDoc.LockDocument 
  acDoc.TransactionManager.EnableGraphicsFlush(True) 
  Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() 
    '***Do stuff 
    acDoc.TransactionManager.QueueForGraphicsFlush() 
    acDoc.TransactionManager.FlushGraphics() 
    acDoc.Editor.UpdateScreen() 
    acTrans.Commit() 
  End Using 
End Using

 Sorry I forget where i found it so cant give proper credit. Smiley Indifferent

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost