Good afternoon,
I need to recognize, via c#, the different types of dimensions (associated (A) or not (B)) as you can see in the attached image. Which is the property? "GeneralDimension.Attached" in my sample doesn't work. is the right property?
How can I do?
Thank you.
Regards,
Mario
Solved! Go to Solution.
Solved by Vladimir.Ananyev. Go to Solution.
GeneralDimension.Attached property is expected to indicate if the given dimension is orphaned or not. Could you upload the simplest dataset that reproduces your case?
Thanks
My customize command:
- reads the files from directory and copy to another
- changes the values of xls reference
- changes the internal reference
- Updates views in drawing document
- saves the document
- runs the function checkOrphDimension to check and delete orphaned dimensions
I use this code:
/// <summary>
/// Delete orphaned quote
/// </summary>
/// <param name="dwg">drawing document</param>
private void checkOrphDimension(Inventor._DrawingDocument dwg)
{
try
{
foreach (Sheet foglio in dwg.Sheets)
{
string nome_foglio = foglio.Name;
foreach (Inventor.GeneralDimension quota in foglio.DrawingDimensions.GeneralDimensions)
{
if (quota.Attached == false)
quota.Delete();
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.ToString());
}
}
Attached you can find the drawing.
Regards,
Mario
It seems that in this case checking the IntentOne or IntentTwo properties will be enough to identify sick dimensions.
If one of these properties produces error you may delete the dimension.
In your drawing I found three sick dimensions. Their model values are:
Cheers,