You can create them. Have a look at this example code:
' Get the current part document and its component definition
Dim doc As PartDocument = ThisDoc.Document
Dim def As PartComponentDefinition = doc.ComponentDefinition
' Prompt the user to select the first face for the dimension
Dim face1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter,
"Select the first face for the linear dimension.")
' Prompt the user to select the second face for the dimension
Dim face2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter,
"Select the second face for the linear dimension.")
' Prompt the user to select a face to serve as the annotation plane
Dim face3 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter,
"Select the annotation plane.")
' Create a point to place the dimension text (placeholder at origin)
Dim textPoint = ThisApplication.TransientGeometry.CreatePoint(0, 0, 0)
' Create geometry intents for the two selected faces (used by the dimension)
Dim intent1 = def.CreateGeometryIntent(face1)
Dim intent2 = def.CreateGeometryIntent(face2)
' Define the annotation plane using the third selected face
Dim annotationPlane = def.ModelAnnotations.CreateAnnotationPlaneDefinitionUsingPlane(face3)
' Get the collection of existing linear model dimensions
Dim linearDimensions = def.ModelAnnotations.ModelDimensions.LinearModelDimensions
' Create a new linear dimension definition between the two faces
Dim linDef = linearDimensions.CreateDefinition(
intent1, intent2, annotationPlane, textPoint, DimensionTypeEnum.kAlignedDimensionType)
' Add the defined dimension to the model
linearDimensions.Add(linDef)
Jelte de Jong
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.

Blog: hjalte.nl - github.com