AnsweredAssumed Answered

How to delete a IDisplayDimension

Question asked by Nikola Malesevic on May 11, 2017
Latest reply on May 12, 2017 by Amen Allah Jlili

While editing the sketch, I create a new dimension, and later I want to delete it. However, the dimension is never selected and thus never deleted.

 

private readonly IModelDoc2 _document;
private readonly IModelDocExtension _extension;
private SketchSegment _lineSplineTangent;
private ISketchPoint _pointRight;
private IDisplayDimension _dimensionHeight;

private void CreateDimension()
{
  _lineSplineTangent.Select(false);
  _pointRight.Select(true);
  _dimensionHeight = (IDisplayDimension)_document.AddVerticalDimension2(0, 0, 0);
}

private void DeleteDimension()
{
  _document.ClearSelection2(true);
  _document.Extension.SelectByID2(_dimensionHeight.GetNameForSelection(), "DIMENSION", 0, 0, 0, false, 1, null, 0);
  _extension.DeleteSelection2();
}

 

How to select a dimension stored in IDisplayDimension object to be able to delete it?

Outcomes