<<...am I right in thinking that this is used for selecting lines as well as
curves?>>
Yes, this property returns all draiwng curves regardless of the curve type
(lines, arcs, circles, etc.)
<
workpoints that are already placed on the appropriate sub assembly or does
it only find the corner points etc.>>
The method finds all drawing edges, centerlines, centermarks and sketch
entities at the point.
I've attached a sample below. It may not be exactly what you want for your
workflow, but shows the general idea.
Sanjay-
Sub ModelToDrawing()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDrawingView As DrawingView
Set oDrawingView = oDoc.ActiveSheet.DrawingViews.Item(1)
' Get the entity from the model (edge, face, etc.)
Dim oModelEntity As Object
Set oModelEntity = .........
Dim oDrawingCurves As DrawingCurvesEnumerator
Set oDrawingCurves = oDrawingView.DrawingCurves(oModelEntity)
If Not oDrawingCurves Is Nothing Then
If oDrawingCurves.Count > 0 Then
Dim oCurve As DrawingCurve
For Each oCurve In oDrawingCurves
Dim oCurveSegment As DrawingCurveSegment
For Each oCurveSegment In oCurve.Segments
oDoc.SelectSet.Select oCurveSegment
Next
Next
End If
Else
If TypeOf oModelEntity Is Edge Then
Dim oModelEdge As Edge
Set oModelEdge = oModelEntity
Dim params(1) As Double
params(0) = 0.25
params(1) = 0.75
Dim points(5) As Double
Call oModelEdge.Evaluator.GetPointAtParam(params, points)
Dim oModelPoint1 As Point
Set oModelPoint1 =
ThisApplication.TransientGeometry.CreatePoint(points(0), points(1),
points(2))
Dim oSheetPoint1 As Point2d
Set oSheetPoint1 = oDrawingView.ModelToSheetSpace(oModelPoint1)
Dim oModelPoint2 As Point
Set oModelPoint2 =
ThisApplication.TransientGeometry.CreatePoint(points(3), points(4),
points(5))
Dim oSheetPoint2 As Point2d
Set oSheetPoint2 = oDrawingView.ModelToSheetSpace(oModelPoint2)
If Not oSheetPoint1.IsEqualTo(oSheetPoint2) Then
oDoc.Activate
Dim oCurves1 As ObjectsEnumerator
Set oCurves1 =
oDrawingView.Parent.FindUsingPoint(oSheetPoint1)
Dim oCurves2 As ObjectsEnumerator
Set oCurves2 =
oDrawingView.Parent.FindUsingPoint(oSheetPoint2)
' If both sample points find the same curve, the curve is of
interest
Dim oCurve1 As Object
Dim oCurve2 As Object
For Each oCurve1 In oCurves1
For Each oCurve2 In oCurves2
If oCurve1 Is oCurve2 Then
oDoc.SelectSet.Select oCurve1
End If
Next
Next
End If
End If
End If
End Sub
wrote in message news:5584709@discussion.autodesk.com...
Sanjay,
Thanks for the reply, It is good to hear that the process is not easy, I
thought it was just me!!
The problem I was having was getting my mind around the
DrawingView.DrawingCurves property, am I right in thinking that this is used
for selecting lines as well as curves?
With reference to the new Sheet.FindUsingPoint method can this locate
workpoints that are already placed on the appropriate sub assembly or does
it only find the corner points etc.
regards
Martin
PS Do you have any code samples you could share?