Object Selection in IDW view

Object Selection in IDW view

Anonymous
Not applicable
637 Views
7 Replies
Message 1 of 8

Object Selection in IDW view

Anonymous
Not applicable
How can I select all the circles in one idw view through vba in Inv 2008, could anybody give me a sample code please?
Thanks
0 Likes
638 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
I've attached a simple macro that selects the circular curves of the
selected drawing view. But, there is one caveat. If the view contains
circular entities which show as straight lines or ellipses in the view (as a
result of the view orientation), such entities are selected as well. You
could filter such entities out by examining the corresponding model geometry
and ignoring the ones with normal vectors that are not the same as the
drawing view orientation vector.

Sanjay-


Sub SelectCircles()

Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oView As DrawingView
Set oView = oDoc.SelectSet.Item(1)

oDoc.SelectSet.Clear

Dim oCurve As DrawingCurve
For Each oCurve In oView.DrawingCurves

If oCurve.CurveType = kCircleCurve Then

Dim oSegment As DrawingCurveSegment
For Each oSegment In oCurve.Segments

oDoc.SelectSet.Select oSegment
Next
End If
Next

End Sub
0 Likes
Message 3 of 8

Anonymous
Not applicable
Thank you very much, Sanjay, for the sample code, I'm still confused with DrawingCurve & DrawingCurveSegment, what's the difference? please. thanks again.
0 Likes
Message 4 of 8

Anonymous
Not applicable
a drawing curve is a collection of DrawingCurveSegments.
0 Likes
Message 5 of 8

Anonymous
Not applicable
A drawing curve is a representation of an edge in the model. Now if the
drawing view is created such that a portion (or portions) of the curve is
obstructed from view in the drawing, the curve is split up into multiple
segments (some visible and some hidden). If the entire curve is visible,
there will be just a single segment.

Sanjay-
0 Likes
Message 6 of 8

Anonymous
Not applicable
Thank you so much Sanjay, I check the object browser, I can't find any information about drawing view orientation vector, could you please tell me how to check the model geometry of the circles and the drawing view orientation vector? If you could post a sample here, that'll be perfect. Thanks.
0 Likes
Message 7 of 8

Anonymous
Not applicable
I think that the easiest way to find the drawing view orientation with
respect to the model is to use the DrawingView.DrawingViewToModelSpace
method (or the DrawingView.SheetToModelSpace method). You can provide any
point as input and the method will return a Line object in model space
indicating the view direction.

The DrawingCurve.ModelGeometry property returns the corresponding entity in
the model which you can use to get further geometrical data.

Sanjay-
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thank you, I'll try that.
0 Likes