Selection
Posted: 17 Jun 2008, 16:45
Hello,
I use CADImport.net and framework .net 2.0.
I work on selection of entities in a dwg file and i get following errors.
-I use original code of source demo ViewerMainForm.cs, in cadPictBox_MouseDown() i want to get selected entities so i add the following line but i get exception "Failed to compare two elements in the array":
CADEntity entEntity = (CADEntity)cadImage.SelectedEntities[0];
-I don't manage to clear drawing of previous selection make by code.
I make a fonction that manage selection. This fonction get list of entities, first it clear previous selection and after it make new selection.
protected void SelectedEntities(CADEntityCollection lstCADEnt)
{
this.cadImage.ClearSelection();
cadImage.ClearBuffer();
cadImage.SelectedEntities.Clear();
if ( lstCADEnt.Count >0)
cadImage.DoSelectEntities(lstCADEnt);
cadPictBox.Invalidate(cadImage.GetSelectEntityRegion(this.cadPictBox.ClientRectangle));
}
When i call the fonction first time, it works, entities appears as selected.
When i call the fonction second time with other list of entities, new entites are selected but previous entities stay selected.
Even if i click to empty zone in map then cadPictBox_MouseDown is call but don't clear drawing of previous selection done by code.
More over if i call the number of entities selected, i always get 0 :
int i = cadImage.SelectEntitiesCount;
-How can i zoom on selected entities ( zoom on selection)?
-How can i make visible selected entities on center of the screen (center on selection)?
-Is CADImport.net working with floating license?
-In a dwg file, DWG TrueView show layout with some layer hide. Where as CADImport show layout with all layers.
Move over CADImport show all data present in the region of the layout where as DWG TrueView show only data that were define as show in the layout.
Does CADImport.net know correctly interpret layout and hide data/layer not present in layout or CADImport just take the area of the layout and show all ?
Best regards, yannick
I use CADImport.net and framework .net 2.0.
I work on selection of entities in a dwg file and i get following errors.
-I use original code of source demo ViewerMainForm.cs, in cadPictBox_MouseDown() i want to get selected entities so i add the following line but i get exception "Failed to compare two elements in the array":
CADEntity entEntity = (CADEntity)cadImage.SelectedEntities[0];
-I don't manage to clear drawing of previous selection make by code.
I make a fonction that manage selection. This fonction get list of entities, first it clear previous selection and after it make new selection.
protected void SelectedEntities(CADEntityCollection lstCADEnt)
{
this.cadImage.ClearSelection();
cadImage.ClearBuffer();
cadImage.SelectedEntities.Clear();
if ( lstCADEnt.Count >0)
cadImage.DoSelectEntities(lstCADEnt);
cadPictBox.Invalidate(cadImage.GetSelectEntityRegion(this.cadPictBox.ClientRectangle));
}
When i call the fonction first time, it works, entities appears as selected.
When i call the fonction second time with other list of entities, new entites are selected but previous entities stay selected.
Even if i click to empty zone in map then cadPictBox_MouseDown is call but don't clear drawing of previous selection done by code.
More over if i call the number of entities selected, i always get 0 :
int i = cadImage.SelectEntitiesCount;
-How can i zoom on selected entities ( zoom on selection)?
-How can i make visible selected entities on center of the screen (center on selection)?
-Is CADImport.net working with floating license?
-In a dwg file, DWG TrueView show layout with some layer hide. Where as CADImport show layout with all layers.
Move over CADImport show all data present in the region of the layout where as DWG TrueView show only data that were define as show in the layout.
Does CADImport.net know correctly interpret layout and hide data/layer not present in layout or CADImport just take the area of the layout and show all ?
Best regards, yannick