Creating bitmap using selected CADEntities
Posted: 13 Sep 2016, 18:52
Hello,
I want to create a bitmap using only the selected CADEntities (in CADEditorControl). I think easy way to do is to set visible property to false for all non selected CADEntities and save it as bitmap, but I don't want to iterate through all CADEntities so tried
creating a new cad image and
used cadImage.CopyEntities and cadImage.PasteEntities to copy the selected entities into new CADImage
code seems to be working fine for most cases but not for CADCurvePolygons.
It is working fine after using cadEntity.AssignEntity for all copied entities,
Not sure why I have to copy the entities again????
but these new CADEntities(CADCurvePolygons) are getting reset(CADCurvePolygon.Boundaries return 0) if I use cadImage.SetNewPosEntity.
What is the best way to create a new CADImage using the selected CADEntities(in CADEditorControl)?
Thanks
Ravi
I want to create a bitmap using only the selected CADEntities (in CADEditorControl). I think easy way to do is to set visible property to false for all non selected CADEntities and save it as bitmap, but I don't want to iterate through all CADEntities so tried
creating a new cad image and
used cadImage.CopyEntities and cadImage.PasteEntities to copy the selected entities into new CADImage
Code: Select all
CADImage cadImage = CADImage.CreateImageByExtension(this.m_strSelectedCADFilePath);
cadImage.Converter.HeadStruct = (HeadVarStruct)cadImage.Converter.HeadStruct.Clone();
cadImage.CopyEntities(m_cadEditorControl.Image.SelectedEntities);
cadImage.PasteEntities();
It is working fine after using cadEntity.AssignEntity for all copied entities,
Not sure why I have to copy the entities again????
Code: Select all
int nCount = 0
foreach(CADEntity cadEntity in cadImage.Converter.Entities)
{
cadEntity.AssignEntity(m_cadEditorControl.Image.SelectedEntities[nCount]);
nCount++
}
Code: Select all
foreach(CADEntity cadEntity in cadImage.Converter.Entities)
{
cadImage.SetNewPosEntity(100, 100, 0, cadEntity);
}
Thanks
Ravi