- MgGeometryType.LineString
StartPoint : Code1 Label
EndPoint : Code2 Label
Code Test Result : Error
Edit Test : Select -> Grip Point Move : Error
public override bool WorldDraw(Drawable drawable, WorldDraw wd)
base.WorldDraw(drawable, wd);
int nEntityType = AcMapFeatureEntityService.GetEntityType(drawable.Id);
if (EntityType.AutoCADEntity == nEntityType) return true;
AcMapLayer mapLayer = AcMapFeatureEntityService.GetLayer(drawable.Id);
MgFeatureQueryOptions mgQueryOptions = new MgFeatureQueryOptions();
mgQueryOptions.SetFilter(mapLayer.Filter);
MgFeatureReader mgFeatureReader = mapLayer.SelectFeatures(mgQueryOptions);
MgAgfReaderWriter mgAgfReadWrite = new MgAgfReaderWriter();
Point3d ptLocation = Point3d.Origin;
while (mgFeatureReader.ReadNext())
{
MgGeometry mgGeometry = mgAgfReadWrite.Read(mgFeatureReader.GetGeometry(strFeatureGeometryName));
MgPoint mgPoint = mgGeometry.Centroid;
string strCode = mgFeatureReader.GetString("DCODE");
ptLocation = new Point3d(mgPoint.Coordinate.X, mgPoint.Coordinate.Y, 0.0);
DBText acText = new DBText();
acText.Position = ptLocation;
acText.Height = 10.0;
acText.TextString = string.Format("DCODE : {0}", strCode);
acText.WorldDraw(wd);
acText.Dispose();
//wd.Geometry.Draw(acText);
//acText.Dispose();
}
mgFeatureReader.Close();
.
.
.
return true;
- MgGeometryType.LineString
StartPoint : Code1 Label
EndPoint : Code2 Label
Code Test Result : Error
Edit Test : Select -> Grip Point Move : Error
public override bool WorldDraw(Drawable drawable, WorldDraw wd)
base.WorldDraw(drawable, wd);
int nEntityType = AcMapFeatureEntityService.GetEntityType(drawable.Id);
if (EntityType.AutoCADEntity == nEntityType) return true;
AcMapLayer mapLayer = AcMapFeatureEntityService.GetLayer(drawable.Id);
MgFeatureQueryOptions mgQueryOptions = new MgFeatureQueryOptions();
mgQueryOptions.SetFilter(mapLayer.Filter);
MgFeatureReader mgFeatureReader = mapLayer.SelectFeatures(mgQueryOptions);
MgAgfReaderWriter mgAgfReadWrite = new MgAgfReaderWriter();
Point3d ptLocation = Point3d.Origin;
while (mgFeatureReader.ReadNext())
{
MgGeometry mgGeometry = mgAgfReadWrite.Read(mgFeatureReader.GetGeometry(strFeatureGeometryName));
MgPoint mgPoint = mgGeometry.Centroid;
string strCode = mgFeatureReader.GetString("DCODE");
ptLocation = new Point3d(mgPoint.Coordinate.X, mgPoint.Coordinate.Y, 0.0);
DBText acText = new DBText();
acText.Position = ptLocation;
acText.Height = 10.0;
acText.TextString = string.Format("DCODE : {0}", strCode);
acText.WorldDraw(wd);
acText.Dispose();
//wd.Geometry.Draw(acText);
//acText.Dispose();
}
mgFeatureReader.Close();
.
.
.
return true;
Can't find what you're looking for? Ask the community or share your knowledge.