0

I am trying to get the number of items present inside the model space. If i am not mistaken the Count does that trick, but I am not able to make it work (I might be wrong).

For example, Set entity = ThisDrawing.ModelSpace.Item(0) gets only the first item. and Set entity = ThisDrawing.ModelSpace.Item(0) gets the second. But how to know how many we have ?

I tried ThisDrawing.ModelSpace.Count but it gives the below error when running it.

enter image description here

tony9099
  • 4,567
  • 9
  • 44
  • 73

1 Answers1

0

Guys The solution for this was to use ThisDrawing.ModelSpace.Count but set it inside an Integer variable. it worked now using the below

Dim X As Long
X = ThisDrawing.ModelSpace.Count 
tony9099
  • 4,567
  • 9
  • 44
  • 73