Sketch Bloks Definition and Geometric Constraints

Sketch Bloks Definition and Geometric Constraints

Anonymous
Not applicable
302 Views
1 Reply
Message 1 of 2

Sketch Bloks Definition and Geometric Constraints

Anonymous
Not applicable

I have a problem to make any geometric constraints on active sketch block definition. When I trying to make constraint I'm getting error. If I will use the same steps to make constraints in just active sketch I have nor problems. Is there any explanation for this?

 

Short example:


Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

Dim obj As Object
Set obj = oPartDoc.ActivatedObject
Dim oSketch As PlanarSketch

Select Case obj.Type
   Case kSketchBlockObject
      Set oSketch = obj.Definition
   Case kSketchBlockDefinitionObject, kPlanarSketchObject
      Set oSketch = obj
   Case Else
      Exit Sub
End Select

 

Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry

 

Dim oLine1 As SketchLine
Set oLine1 = oSketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(-2.5, 0), oTG.CreatePoint2d(2.5, 0))

 

Dim oLine2 As SketchLine
Set oLine2 = oSketch.SketchLines.AddByTwoPoints(oTG.CreatePoint2d(0, -2.5), oTG.CreatePoint2d(0, 2.5))

 

Dim oGeomConstraints As Inventor.GeometricConstraints
Set oGeomConstraints = oSketch.GeometricConstraints

Call oGeomConstraints.AddPerpendicular(oLine1, oLine2) 'Error here

0 Likes
303 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Still nothing on it? I have 2017 version of inventor now. This feil is still there. Can anyone from autodesk tell me if this is a bug or I'm doing something wrong?
0 Likes