I'm writing a code to add ordinate dimensions and manipulate its position later base on some conditions.
When I add a new ordinate dimension and I try to count the displayed dimensions it doesn't consider the just created dimension.
Below I show how I am selecting the first displayed dimension (dimension 0 or base dimension) and a vertex, then I add an ordinate dimension for that vertex. Then I count the displayed dimensions and it gives me the number of dimensions - 1 (doesn't count the just added dimension).
I also created an array with the displayed dimensions and the last created one is not included in the array neither (I did this just to check).
'Get base/first ordinate dimension
Set swDispDim = swView.GetFirstDisplayDimension5
Set swAnn = swDispDim.GetAnnotation
'Select base/first ordinate dimension
swAnn.Select3 False, Nothing
'Select certain vertex
swVertex.Select4 True, Nothing
'Add vertex to the ordinate dimensions
"UNTIL HERE EVERYTHING GOES RIGHT"
'Get displayed dimension count
count = swView.GetDisplayDimensionCount
"HERE THE PROBLE COMES, count SHOWS THE NUMBER OF DIMENSIONS MINUS 1"
'Create array for the displayed dimensions
Annotations = swView.GetDisplayDimensions
"THE LAST DIMENSION DOESN'T APPEAR IN THE ARRAY"
I also cleared any selection and I rebuilt the file but still happening the same.
Does anyone now what I'm missing?
Thank you in advance.