I am attempting to auto align dimensions on a drawing from the api as they tend to move when the model resizes in the view (or features are added/removed). I am getting inconsistent results at best... some dimensions align, some go way off the page. Some start out way off the page and never come in (even though there aren't any dimensions keeping it from coming in).
It is absolutely critical I get this working as these drawings are being generated automatically and I can't afford to have someone touch each one to fix it.
Any help wold be appreciated. Below is my code:
'Select all the dimensions
oAnn = swView.GetAnnotations()
For Each swAnn In oAnn
If swAnn.Visible = SwConst.swAnnotationVisibilityState_e.swAnnotationVisible And swAnn.GetType = SwConst.swAnnotationType_e.swDisplayDimension Then
If swModelDoc.Extension.SelectByID2(swAnn.GetName & "@" & swView.GetName2, "DIMENSION", 0, 0, 0, True, 0, Nothing, SwConst.swSelectOption_e.swSelectOptionDefault) Then
Debug.Print("Selected: " & swAnn.GetName & "@" & swView.GetName2)
Debug.Print("Failed to select: " & swAnn.GetName & "@" & swView.GetName2)
'Auto align the dimensions
It is critical I get this working as soon as possible.
I see you specify very large number for distance:
Note, this is in meters. Try 0.001.
How is this functionality working from UI?
Application Engineer at Intercad
Tel: +61 2 9454 4444