- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to add an angular foreshortened dimension in a drawing
This should be possible with the AddAngularForeshortened function.
Situation:
First i select a drawingcurve, added by including a skecth from the assembly. this is a drawingcurve object.
second i select the centermark. (Centermark object.)
in the code i am creating a line the represents the vertical line of the centermark, going up.
the objects should have the right type but the i get an error when i add the dimension.
I tried the code with 2 drawingcurve object and this worked, but somehow i can't get the centermark line to work.
Is there any way to get this to work with a drawingcurve and a centermark?
Sub CreateAngularForeshortenedDim
' Open a drawing document and select two parallel linear curves in same drawing view first.
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oDoc As DrawingDocument
Set oDoc = oApp.ActiveDocument
Dim oCurve1 As DrawingCurve, oCurve2 As Centermark
Set oCurve1 = oDoc.SelectSet(1).Parent
Set oCurve2 = oDoc.SelectSet(2)
Dim oSheet As Sheet
Set oSheet = oDoc.ActiveSheet
Dim oLine As Line2d
Set oLine = oApp.TransientGeometry.CreateLine2d(oCurve2.Position, oCurve2.ExtensionPointTwoDirection)
Dim oAngle As Boolean
oAngle = False
' Create two GeometryIntent based on the selected drawing curve segments.
Dim oIntent1 As GeometryIntent, oIntent2 As GeometryIntent, oIntent3 As GeometryIntent
Set oIntent1 = oSheet.CreateGeometryIntent(oCurve1)
Set oIntent2 = oSheet.CreateGeometryIntent(oLine)
Set oIntent3 = oSheet.CreateGeometryIntent(oCurve2)
Dim oTextPos As Point2d
Set oTextPos = oApp.TransientGeometry.CreatePoint2d(20, 30)
' Create the foreshortened dimension
Dim oAngularForeshortenedDim As AngularGeneralDimension
Set oAngularForeshortenedDim = oSheet.DrawingDimensions.GeneralDimensions.AddAngularForeshortened(oTextPos, oIntent1, oIntent2, , True, True, False)
End Sub
Kind regards,
Geert
Solved! Go to Solution.