I create dimension feature class I change the style, add dimensions to my map but when I reopen the map the dimensions are gone? Is there documentation I can read about this behavior. I am also interested in creating dimensions with python code but I have found no examples.
Update- I created a button that creates a dim with style inside a geodatabase, now when I close and open the map the dimensions are just red polygons.


after close and open arcmap before close and open
Here is the code I sued to create the dimension feature class.
IFeatureLayer pFeatureLayer <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IFeatureLayer<SPAN class="punctuation token">)</SPAN>pBoundaryLayer<SPAN class="punctuation token">;</SPAN>
IFeatureClass pFeatureClass <SPAN class="operator token">=</SPAN> pFeatureLayer<SPAN class="punctuation token">.</SPAN>FeatureClass<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> strCatalogPath <SPAN class="operator token">=</SPAN> <SPAN class="token function">GetCatalogPath</SPAN><SPAN class="punctuation token">(</SPAN>pFeatureClass<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IWorkspace pWorkspace <SPAN class="operator token">=</SPAN> <SPAN class="token function">FileGDBWorkspaceFromPropertySet</SPAN><SPAN class="punctuation token">(</SPAN>strCatalogPath<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IObjectClassDescription ocDescription <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">DimensionClassDescription</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IFields pRequiredFields <SPAN class="operator token">=</SPAN> ocDescription<SPAN class="punctuation token">.</SPAN>RequiredFields<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">int</SPAN> intShapeFieldPosition <SPAN class="operator token">=</SPAN> pRequiredFields<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FindField</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Shape"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IField pShapeField <SPAN class="operator token">=</SPAN> pRequiredFields<SPAN class="punctuation token">.</SPAN><SPAN class="token function">get_Field</SPAN><SPAN class="punctuation token">(</SPAN>intShapeFieldPosition<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IGeometryDef pGeomDef <SPAN class="operator token">=</SPAN> pShapeField<SPAN class="punctuation token">.</SPAN>GeometryDef<SPAN class="punctuation token">;</SPAN>
IGeometryDefEdit pGeomDefEdit <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IGeometryDefEdit<SPAN class="punctuation token">)</SPAN>pGeomDef<SPAN class="punctuation token">;</SPAN>
ISpatialReferenceFactory3 pSpatRefFac <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SpatialReferenceEnvironmentClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ISpatialReference pSpatRef <SPAN class="operator token">=</SPAN> pSpatRefFac<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateSpatialReference</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">6578</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IProjectedCoordinateSystem pProSpatRef <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IProjectedCoordinateSystem<SPAN class="punctuation token">)</SPAN>pSpatRef<SPAN class="punctuation token">;</SPAN>
ILinearUnit linUnit <SPAN class="operator token">=</SPAN> pProSpatRef<SPAN class="punctuation token">.</SPAN>CoordinateUnit<SPAN class="punctuation token">;</SPAN>
pGeomDefEdit<SPAN class="punctuation token">.</SPAN>SpatialReference_2 <SPAN class="operator token">=</SPAN> pSpatRef<SPAN class="punctuation token">;</SPAN>
IFeatureWorkspace pFeatWorkspace <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IFeatureWorkspace<SPAN class="punctuation token">)</SPAN>pWorkspace<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> pName <SPAN class="operator token">=</SPAN> <SPAN class="string token">"DIM"</SPAN><SPAN class="punctuation token">;</SPAN>
IFeatureClass pNewFeatureClass <SPAN class="operator token">=</SPAN> pFeatWorkspace<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateFeatureClass</SPAN><SPAN class="punctuation token">(</SPAN>pName<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> pRequiredFields<SPAN class="punctuation token">,</SPAN> ocDescription<SPAN class="punctuation token">.</SPAN>InstanceCLSID<SPAN class="punctuation token">,</SPAN> ocDescription<SPAN class="punctuation token">.</SPAN>ClassExtensionCLSID<SPAN class="punctuation token">,</SPAN> esriFeatureType<SPAN class="punctuation token">.</SPAN>esriFTDimension<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Shape"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ISchemaLock schemaLock <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>ISchemaLock<SPAN class="punctuation token">)</SPAN>pNewFeatureClass<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">try</SPAN>
<SPAN class="punctuation token">{</SPAN>
schemaLock<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ChangeSchemaLock</SPAN><SPAN class="punctuation token">(</SPAN>esriSchemaLock<SPAN class="punctuation token">.</SPAN>esriExclusiveSchemaLock<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IDimensionClassExtension dimExtension <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IDimensionClassExtension<SPAN class="punctuation token">)</SPAN>pNewFeatureClass<SPAN class="punctuation token">.</SPAN>Extension<SPAN class="punctuation token">;</SPAN>
dimExtension<SPAN class="punctuation token">.</SPAN>ReferenceScale <SPAN class="operator token">=</SPAN> <SPAN class="number token">12000</SPAN><SPAN class="punctuation token">;</SPAN>
dimExtension<SPAN class="punctuation token">.</SPAN>ReferenceScaleUnits <SPAN class="operator token">=</SPAN> esriUnits<SPAN class="punctuation token">.</SPAN>esriFeet<SPAN class="punctuation token">;</SPAN>
IDimensionStyle dimensionStyle <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">DimensionStyleClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dimensionStyle<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">=</SPAN> <SPAN class="string token">"BEARING_DISTANCE"</SPAN><SPAN class="punctuation token">;</SPAN>
IDimensionStyleText dimText <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IDimensionStyleText<SPAN class="punctuation token">)</SPAN>dimensionStyle<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">string</SPAN> expression <SPAN class="operator token">=</SPAN> <SPAN class="string token">"def FindLabel ( [DIMLENGTH], [BEGINX] , [BEGINY] , [ENDX] , [ENDY] ):"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" import math"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dY = float([ENDY]) -float( [BEGINY])"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dX = float( [ENDX])-float( [BEGINX])"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" azimuth = math.atan2(dX, dY) * 180 / math.pi"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth < 0:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" azimuth = azimuth + 360"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth > 270 and azimuth<= 360:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" bearing = 360 - azimuth"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(bearing * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"N \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" W\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth > 180 and azimuth<= 270:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" bearing = azimuth - 180"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(bearing * 3600, 60)"</SPAN><SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN><SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"S \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" W\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth > 90 and azimuth<= 180:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" bearing = 180 - azimuth"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(bearing * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"S \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" E\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth >= 0 and azimuth<= 90:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(azimuth * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"N \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" E\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" else:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth > 270 and azimuth<= 360:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" bearing = 360 - azimuth"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(bearing * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"N \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" W\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth > 180 and azimuth<= 270:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" bearing = azimuth - 180"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(bearing * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"S \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" W\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth > 90 and azimuth<= 180:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" bearing = 180 - azimuth"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(bearing * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"S \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" E\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" if azimuth >= 0 and azimuth<= 90:"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" minutes,seconds = divmod(azimuth * 3600, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" degrees,minutes = divmod(minutes, 60)"</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" dmsBearing = \"N \" + str(int(degrees)) + \"°\" + str(int(minutes)) + \"'\" + str(round(seconds, 2)) + \" E\""</SPAN> <SPAN class="operator token">+</SPAN> Environment<SPAN class="punctuation token">.</SPAN>NewLine <SPAN class="operator token">+</SPAN>
<SPAN class="string token">" return dmsBearing + \" \" + str(round(float( [DIMLENGTH]), 2))+\"'\""</SPAN><SPAN class="punctuation token">;</SPAN>
dimText<SPAN class="punctuation token">.</SPAN>Expression <SPAN class="operator token">=</SPAN> expression<SPAN class="punctuation token">;</SPAN>
dimText<SPAN class="punctuation token">.</SPAN>ExpressionSimple <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN>
dimText<SPAN class="punctuation token">.</SPAN>ExpressionParserName <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Python"</SPAN><SPAN class="punctuation token">;</SPAN>
dimText<SPAN class="punctuation token">.</SPAN>TextDisplay <SPAN class="operator token">=</SPAN> esriDimensionTextDisplay<SPAN class="punctuation token">.</SPAN>esriDimensionTDExpression<SPAN class="punctuation token">;</SPAN>
dimText<SPAN class="punctuation token">.</SPAN>ExtendLineOnFit <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN>
stdole<SPAN class="punctuation token">.</SPAN>IFontDisp iFont <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">stdole<SPAN class="punctuation token">.</SPAN>StdFontClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> stdole<SPAN class="punctuation token">.</SPAN>IFontDisp<SPAN class="punctuation token">;</SPAN>
iFont<SPAN class="punctuation token">.</SPAN>Name <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Arial"</SPAN><SPAN class="punctuation token">;</SPAN>
iFont<SPAN class="punctuation token">.</SPAN>Size <SPAN class="operator token">=</SPAN> <SPAN class="number token">8</SPAN><SPAN class="punctuation token">;</SPAN>
ITextSymbol txtSymbol <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">TextSymbol</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
txtSymbol<SPAN class="punctuation token">.</SPAN>Font <SPAN class="operator token">=</SPAN> iFont<SPAN class="punctuation token">;</SPAN>
dimText<SPAN class="punctuation token">.</SPAN>TextSymbol <SPAN class="operator token">=</SPAN> txtSymbol<SPAN class="punctuation token">;</SPAN>
IDimensionStyleDisplay dimDisplay <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IDimensionStyleDisplay<SPAN class="punctuation token">)</SPAN>dimensionStyle<SPAN class="punctuation token">;</SPAN>
dimDisplay<SPAN class="punctuation token">.</SPAN>MarkerDisplay <SPAN class="operator token">=</SPAN> esriDimensionDisplay<SPAN class="punctuation token">.</SPAN>esriDimensionDisplayBoth<SPAN class="punctuation token">;</SPAN>
IArrowMarkerSymbol mrkrSym <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArrowMarkerSymbolClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
mrkrSym<SPAN class="punctuation token">.</SPAN>Size <SPAN class="operator token">=</SPAN> <SPAN class="number token">6</SPAN><SPAN class="punctuation token">;</SPAN>
IMarkerSymbol newMrkrSym <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IMarkerSymbol<SPAN class="punctuation token">)</SPAN>mrkrSym<SPAN class="punctuation token">;</SPAN>
dimDisplay<SPAN class="punctuation token">.</SPAN>BeginMarkerSymbol <SPAN class="operator token">=</SPAN> newMrkrSym<SPAN class="punctuation token">;</SPAN>
dimDisplay<SPAN class="punctuation token">.</SPAN>EndMarkerSymbol <SPAN class="operator token">=</SPAN> newMrkrSym<SPAN class="punctuation token">;</SPAN>
dimDisplay<SPAN class="punctuation token">.</SPAN>MarkerFit <SPAN class="operator token">=</SPAN> esriDimensionMarkerFit<SPAN class="punctuation token">.</SPAN>esriDimensionMarkerFitText<SPAN class="punctuation token">;</SPAN>
IDimensionStyles dimensionStyles <SPAN class="operator token">=</SPAN> dimExtension<SPAN class="punctuation token">.</SPAN>DimensionStyles<SPAN class="punctuation token">;</SPAN>
dimensionStyles<SPAN class="punctuation token">.</SPAN><SPAN class="token function">AddStyle</SPAN><SPAN class="punctuation token">(</SPAN>dimensionStyle<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">catch</SPAN><SPAN class="punctuation token">(</SPAN>COMException comExcept<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
MessageBox<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Show</SPAN><SPAN class="punctuation token">(</SPAN>comExcept<SPAN class="punctuation token">.</SPAN>StackTrace<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">finally</SPAN>
<SPAN class="punctuation token">{</SPAN>
schemaLock<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ChangeSchemaLock</SPAN><SPAN class="punctuation token">(</SPAN>esriSchemaLock<SPAN class="punctuation token">.</SPAN>esriSharedSchemaLock<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MessageBox<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Show</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"The Dimension Feature Class Has Been Created"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Is there something I can add to make this layer persist?