- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to use MeasureTools to determine the distance between a sketch equation curve and and a sketch spline. Here is the simple code.
Public Sub distance()
Set oDoc = ThisApplication.ActiveDocument 'load active document
'define transient geometry
Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry
'define sketch
Dim sketch As sketch
Set sketch = oDoc.ComponentDefinition.Sketches.Item(1)
'define entities to measure
Dim curve1, curve2 As Object
Set curve1 = sketch.SketchEquationCurves(1)
Set curve2 = sketch.SketchSplines(1)
'measure distance between the two entities
dist = ThisApplication.MeasureTools.GetMinimumDistance(curve1, curve2)
End Sub
Whatever I do, it shows me an error code:
Run-time error '-2147024809 (80070057)'
Expecting object to be local
What can I do to avoid this message.
Solved! Go to Solution.