Message 1 of 2
AutoDesk VBA

Not applicable
04-08-2019
01:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone !
I need a solution to measure the diameter of a pipe in an assembly when I select it.
I use currently this code:
Dim K As Integer
Dim CompenentOccurrence As ComponentOccurrence
For K = 1 To ThisApplication.ActiveDocument.SelectSet.Count
Set ComponentOccurrence = ThisApplication.ActiveDocument.SelectSet.Item(K)
Dim Interpoint As Point2d
TextBox1.Value = ComponentOccurrence.Name & " " & " Diameter : " & Round((((4 * Face.Evaluator.Area) / (3.14)) ^ 0.5) * 10, 0) & "mm"
But It calculate the area of the all surface of the pipe.
I would like to have automatically the diameter of the pipe, when I select it !
Could you help me ?
Kevin