- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having a specific issue when using ordinate dimensions.
Firstly, I am placing an ordinate dimension set based of a collection of centerlines.
Set oCLCol = SortAngledCLCollection(oCLCol, "V")
'
For Each oCL In oCLCol
If oCL.StartPoint.Y > oCL.EndPoint.Y Then
Set oAttachPoint1 = oCL.StartPoint
Else
Set oAttachPoint1 = oCL.EndPoint
End If
Set oAttachPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(oAttachPoint1.X, oAttachPoint1.Y)
Set oIntent1 = oSheet.CreateGeometryIntent(oCL, oAttachPoint1)
Call oIntentCol.Add(oIntent1)
Next
Set oAttachPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(oDrawView.Center.X, oDrawView.Center.Y + oDrawView.Height)
Call oSheet.DrawingDimensions.OrdinateDimensionSets.Add(oIntentCol, oAttachPoint1, kAlignedToCurveDimensionType)
When I try to go given a centerline and match up weather or not the centerline has a ordinate dimension it doesn't seem to find it. When I delete the member from the set and add it manually back to the set the intent is found. But for some reason when I add them through the above code it doesn't seem to find the intent. I just wander if I am doing something odd. I have also tried to remove the "oAttachPoint1" to the create geometry and it still didn't seem to work and created a dim at each end of the centerline which is not what I'm wanting. This is rough code definitely not finished.
Below is what I was trying to put together to find the intent based off of the above set added to my drawing view. I'm manually selecting the centerline on the drawing view that has an ordinate dimension already attached. The purpose of this entire check is to make sure I am not duplicating ordinate dimensions. I'm creating ordinate dimension set automation and want to not cause duplication or dimensions on top of dimensions.
Public Sub OrdinateDimTest()
Dim oCLIn As Centerline: Set oCLIn = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kDrawingCenterlineFilter, "Select a Centerline.")
Dim oIntentIn As GeometryIntent
Dim oIntentIn2 As GeometryIntent
Dim oAttachPoint1 As Point2d
Dim oAttachPoint2 As Point2d
Dim oWorkFeatureIn As Object
Dim oOccIn As ComponentOccurrence
Dim strFamIn As String
Dim oDrawDoc As DrawingDocument: Set oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet: Set oSheet = oDrawDoc.ActiveSheet
Dim oDrawDims As DrawingDimensions: Set oDrawDims = oSheet.DrawingDimensions
Dim oOrdDimSets As OrdinateDimensionSets: Set oOrdDimSets = oDrawDims.OrdinateDimensionSets
Dim oOrdDimSet As OrdinateDimensionSet
Dim oMembers As OrdinateDimensionsEnumerator
Dim oMember As OrdinateDimension
Dim oIntent As GeometryIntent
Dim oCL As Centerline
Dim oWorkFeature As Object
Dim oOcc As ComponentOccurrence
Dim oOccDoc As Document
Dim strFam As String
Dim blnAddMember As Boolean
Dim oOrdDims As OrdinateDimensions: Set oOrdDims = oDrawDims.OrdinateDimensions
Dim oOrdDim As OrdinateDimension
If oCLIn.StartPoint.Y > oCLIn.EndPoint.Y Then
Set oAttachPoint1 = oCLIn.StartPoint
Else
Set oAttachPoint1 = oCLIn.EndPoint
End If
Set oIntentIn = oSheet.CreateGeometryIntent(oCLIn, oCLIn.StartPoint)
Set oIntentIn2 = oSheet.CreateGeometryIntent(oCLIn, oCLIn.EndPoint)
For Each oOrdDim In oOrdDims
Set oIntent = oOrdDim.Intent
If oIntent.Geometry Is oIntentIn.Geometry Then
Debug.Print "Here"
End If
If oIntent.Geometry Is oIntentIn2.Geometry Then
Debug.Print "Here"
End If
Next
End Sub
Tiffany Hayden
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Solved! Go to Solution.