AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FDO AcMapLayer Multi Label Style (DrawableOverrule).?

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
507 Views, 0 Replies

FDO AcMapLayer Multi Label Style (DrawableOverrule).?

Anonymous
Not applicable

 

- 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;

 

0 Likes

FDO AcMapLayer Multi Label Style (DrawableOverrule).?

 

- 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;

 

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report