Hello. I have problem with TopologyClean.Init(action, IdCollection). If I use ObjectIdCollection, or if I use null, I have same result. "All" object are cleaning, not only this in my ObjectIdCollection (I can't anchor objects). What I doing wrong? Thanks.
Hello. I have problem with TopologyClean.Init(action, IdCollection). If I use ObjectIdCollection, or if I use null, I have same result. "All" object are cleaning, not only this in my ObjectIdCollection (I can't anchor objects). What I doing wrong? Thanks.
Do you have a buildable sample project and necessory dataset to help us to reproduce your problem?
Do you have a buildable sample project and necessory dataset to help us to reproduce your problem?
Here is sample project and drawing.
Here is sample project and drawing.
Thank you for the sample.
I tested it with your dwg it seems working fine for me. Here is what I did:
1. turn off all layers except LINE-LAYER, select an edge of the squre, I can see the selection contains 2 lines, so it contains duplicated lines.
2. Did the same thing with layer AAA, the lines on layer AAA is not duplicated, so I go ahead to copy it at the same position to make the lines are duplicated in layer AAA as well
3. run your sample with TopologyClean.Init with following object collection, it is supposed to only clean the layer LINE-LAYER:
ObjectIdCollection retVal = null;
var editor = Application.DocumentManager.MdiActiveDocument.Editor;
// TypedValue array to define the filter criteria.
var values = new TypedValue[2];
var objectValue = new TypedValue((int)DxfCode.Start, "LINE");
var layerValue = new TypedValue(
(int)DxfCode.LayerName,
"LINE-LAYER");
values.SetValue(objectValue, 0);
values.SetValue(layerValue, 1);
// Assign the filter criteria to a SelectionFilter object
var filter = new SelectionFilter(values);
4. After cleaning, I check the layer LINE-LAYER, it does be cleaned, no duplicated lines at same postion.
Check layer AAA, it is not affected, the duplicated lines are still there. That is an expected behavior for me.
Am I missing anythig to reproduce your problem?
Thank you for the sample.
I tested it with your dwg it seems working fine for me. Here is what I did:
1. turn off all layers except LINE-LAYER, select an edge of the squre, I can see the selection contains 2 lines, so it contains duplicated lines.
2. Did the same thing with layer AAA, the lines on layer AAA is not duplicated, so I go ahead to copy it at the same position to make the lines are duplicated in layer AAA as well
3. run your sample with TopologyClean.Init with following object collection, it is supposed to only clean the layer LINE-LAYER:
ObjectIdCollection retVal = null;
var editor = Application.DocumentManager.MdiActiveDocument.Editor;
// TypedValue array to define the filter criteria.
var values = new TypedValue[2];
var objectValue = new TypedValue((int)DxfCode.Start, "LINE");
var layerValue = new TypedValue(
(int)DxfCode.LayerName,
"LINE-LAYER");
values.SetValue(objectValue, 0);
values.SetValue(layerValue, 1);
// Assign the filter criteria to a SelectionFilter object
var filter = new SelectionFilter(values);
4. After cleaning, I check the layer LINE-LAYER, it does be cleaned, no duplicated lines at same postion.
Check layer AAA, it is not affected, the duplicated lines are still there. That is an expected behavior for me.
Am I missing anythig to reproduce your problem?
No, I did not turn of layers then cleaning, I just turn off layers to verify the results.
Sorry for the misunderstanding.
No, I did not turn of layers then cleaning, I just turn off layers to verify the results.
Sorry for the misunderstanding.
You are welcome Robert, please let us know if there is anything we can help.
You are welcome Robert, please let us know if there is anything we can help.
Can't find what you're looking for? Ask the community or share your knowledge.