<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic creating dimstyles in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340351#M83642</link>
    <description>Does anyone know how to add a new dimstyle to a drawing and then alter the system variables and then save it?  We have 4 dimstyles we need to have in the drawings and want to have an automation that makes sure all 4 are there if someone purges.  Kind of like a no-brainer of import dimstyles.&lt;BR /&gt;
Thanks.</description>
    <pubDate>Wed, 06 Jun 2001 06:04:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2001-06-06T06:04:16Z</dc:date>
    <item>
      <title>creating dimstyles</title>
      <link>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340351#M83642</link>
      <description>Does anyone know how to add a new dimstyle to a drawing and then alter the system variables and then save it?  We have 4 dimstyles we need to have in the drawings and want to have an automation that makes sure all 4 are there if someone purges.  Kind of like a no-brainer of import dimstyles.&lt;BR /&gt;
Thanks.</description>
      <pubDate>Wed, 06 Jun 2001 06:04:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340351#M83642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-06-06T06:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: creating dimstyles</title>
      <link>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340352#M83643</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Using VBA methods, I have only been able to get the &lt;BR /&gt;
style changes to apply as an override.&amp;nbsp; Using a SendCommand allows the &lt;BR /&gt;
overrides to be saved back to the parent style.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Application.ActiveDocument.ActiveDimStyle = &lt;BR /&gt;
Application.ActiveDocument.DimStyles.Item(StyleName)&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;"Your modifications here"&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Application.ActiveDocument.SendCommand "-dimstyle" &lt;BR /&gt;
&amp;amp; vbCr &amp;amp; "SAVE" &amp;amp; vbCr &amp;amp; "StyleName" &amp;amp; vbCr &amp;amp; "YES" &lt;BR /&gt;
&amp;amp; vbCr&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"brunbrun" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:cbrunner@wdae.com"&amp;gt;cbrunner@wdae.com&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f056457.-1@WebX.maYIadrTaRb"&amp;gt;news:f056457.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;Does &lt;BR /&gt;
  anyone know how to add a new dimstyle to a drawing and then alter the system &lt;BR /&gt;
  variables and then save it? We have 4 dimstyles we need to have in the &lt;BR /&gt;
  drawings and want to have an automation that makes sure all 4 are there if &lt;BR /&gt;
  someone purges. Kind of like a no-brainer of import dimstyles. &lt;BR /&gt;
&lt;BR /&gt;Thanks.&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 06 Jun 2001 06:37:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340352#M83643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-06-06T06:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: creating dimstyles</title>
      <link>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340353#M83644</link>
      <description>I created a dimstyle module for my program -- pretty much copied the way i&lt;BR /&gt;
wrote it in LISP, but it works quite well.  Here it is exactly (i know there&lt;BR /&gt;
is some "repetitive setting" going on, but the end result creates me the&lt;BR /&gt;
dimstyle i want).  Also, our company draws in metric and dimensions in&lt;BR /&gt;
inches or millimeters.  Watch for word-wrap.&lt;BR /&gt;
&lt;BR /&gt;
'-------------------------------------- Begin Dimstyle&lt;BR /&gt;
module --------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
'Dimension style names&lt;BR /&gt;
Public Const DIMSTYLE_FTFRAC As String = "Z-TMI-FEET-FRAC"&lt;BR /&gt;
Public Const DIMSTYLE_INFRAC As String = "Z-TMI-INCH-FRAC"&lt;BR /&gt;
Public Const DIMSTYLE_FTDEC As String = "Z-TMI-FEET-DEC"&lt;BR /&gt;
Public Const DIMSTYLE_INDEC As String = "Z-TMI-INCH-DEC"&lt;BR /&gt;
Public Const DIMSTYLE_MM0 As String = "Z-TMI-MM-0DEC"&lt;BR /&gt;
Public Const DIMSTYLE_MM1 As String = "Z-TMI-MM-1DEC"&lt;BR /&gt;
Public Const DIMSTYLE_MM2 As String = "Z-TMI-MM-2DEC"&lt;BR /&gt;
Public Const DIMSTYLE_ANG As String = "Z-TMI-ANGLE"&lt;BR /&gt;
Public Const DIMSTYLE_UNIT As String = "Z-TMI-UNITNO"&lt;BR /&gt;
&lt;BR /&gt;
Public Sub SetDimstyle(ByVal DimstyleName As String)&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
&lt;BR /&gt;
    Dim Multiplier As Double&lt;BR /&gt;
    Dim objDimstyle As AcadDimStyle&lt;BR /&gt;
&lt;BR /&gt;
    Multiplier = 1&lt;BR /&gt;
    Set objDimstyle = ThisDrawing.DimStyles(DimstyleName)&lt;BR /&gt;
&lt;BR /&gt;
    'If the dimstyle doesn't exist, then make it&lt;BR /&gt;
    If objDimstyle Is Nothing Then&lt;BR /&gt;
        With ThisDrawing&lt;BR /&gt;
&lt;BR /&gt;
            'Dimstyle name&lt;BR /&gt;
            .SetVariable "DIMTXSTY", DimTextStyle.Name&lt;BR /&gt;
&lt;BR /&gt;
            'String variables&lt;BR /&gt;
            '.SetVariable "DIMPOST",   "."     * * * * * VARIES, SEE BELOW&lt;BR /&gt;
            .SetVariable "DIMAPOST", "."&lt;BR /&gt;
            .SetVariable "DIMBLK", "."&lt;BR /&gt;
            .SetVariable "DIMBLK1", "."&lt;BR /&gt;
            .SetVariable "DIMBLK2", "."&lt;BR /&gt;
&lt;BR /&gt;
            'Dimscale&lt;BR /&gt;
            .SetVariable "DIMSCALE", 1   '&amp;lt;-- override as needed outside of&lt;BR /&gt;
module&lt;BR /&gt;
&lt;BR /&gt;
            'Real variables&lt;BR /&gt;
            .SetVariable "DIMASZ", Multiplier * 3&lt;BR /&gt;
            .SetVariable "DIMEXO", Multiplier * 0.8&lt;BR /&gt;
            .SetVariable "DIMDLI", Multiplier * 6.25&lt;BR /&gt;
            .SetVariable "DIMEXE", Multiplier * 1#&lt;BR /&gt;
            .SetVariable "DIMRND", Multiplier * 0#&lt;BR /&gt;
            .SetVariable "DIMDLE", Multiplier * 0#&lt;BR /&gt;
            .SetVariable "DIMTP", Multiplier * 0#&lt;BR /&gt;
            .SetVariable "DIMTM", Multiplier * 0#&lt;BR /&gt;
            .SetVariable "DIMTXT", Multiplier * 1.9&lt;BR /&gt;
            .SetVariable "DIMCEN", Multiplier * 0#&lt;BR /&gt;
            .SetVariable "DIMTSZ", Multiplier * 0.8&lt;BR /&gt;
            .SetVariable "DIMALTF", Multiplier * 1#&lt;BR /&gt;
            '.SetVariable "DIMLFAC" ,Multiplier * 1.0     * * * * * VARIES,&lt;BR /&gt;
SEE BELOW&lt;BR /&gt;
            .SetVariable "DIMTVP", Multiplier * 1#&lt;BR /&gt;
            .SetVariable "DIMGAP", Multiplier * 0.5&lt;BR /&gt;
            .SetVariable "DIMTFAC", Multiplier * 0.7&lt;BR /&gt;
&lt;BR /&gt;
            'Integer variables&lt;BR /&gt;
            .SetVariable "DIMTOL", 0&lt;BR /&gt;
            .SetVariable "DIMLIM", 0&lt;BR /&gt;
            .SetVariable "DIMTIH", 0&lt;BR /&gt;
            .SetVariable "DIMTOH", 0&lt;BR /&gt;
            .SetVariable "DIMSE1", 0&lt;BR /&gt;
            .SetVariable "DIMSE2", 0&lt;BR /&gt;
            .SetVariable "DIMTAD", 1&lt;BR /&gt;
            .SetVariable "DIMZIN", 11&lt;BR /&gt;
            .SetVariable "DIMALT", 0&lt;BR /&gt;
            .SetVariable "DIMALTD", 2&lt;BR /&gt;
            .SetVariable "DIMTOFL", 1&lt;BR /&gt;
            .SetVariable "DIMSAH", 1&lt;BR /&gt;
            .SetVariable "DIMTIX", 0      '   &amp;lt;- dimension text forced&lt;BR /&gt;
inside 0=off, 1=on&lt;BR /&gt;
            .SetVariable "DIMSOXD", 0&lt;BR /&gt;
            .SetVariable "DIMCLRD", 0     '   &amp;lt;- dimension line color&lt;BR /&gt;
            .SetVariable "DIMCLRE", 0     '   &amp;lt;- dimension extension line&lt;BR /&gt;
color&lt;BR /&gt;
            .SetVariable "DIMCLRT", 0     '   &amp;lt;- dimension text color&lt;BR /&gt;
            '.SetVariable "DIMUNIT" ,  2  * * * * * VARIES, SEE BELOW&lt;BR /&gt;
            '.SetVariable "DIMDEC" ,  0   * * * * * VARIES, SEE BELOW&lt;BR /&gt;
            .SetVariable "DIMTDEC", 2&lt;BR /&gt;
            .SetVariable "DIMALTU", 2&lt;BR /&gt;
            .SetVariable "DIMALTD", 2&lt;BR /&gt;
            .SetVariable "DIMALTTD", 2&lt;BR /&gt;
            .SetVariable "DIMAUNIT", 0&lt;BR /&gt;
            .SetVariable "DIMJUST", 0&lt;BR /&gt;
            .SetVariable "DIMSD1", 0&lt;BR /&gt;
            .SetVariable "DIMSD2", 0&lt;BR /&gt;
            .SetVariable "DIMTOLJ", 1&lt;BR /&gt;
            .SetVariable "DIMTZIN", 0&lt;BR /&gt;
            .SetVariable "DIMALTZ", 11&lt;BR /&gt;
            .SetVariable "DIMALTTZ", 0&lt;BR /&gt;
            .SetVariable "DIMFIT", 3&lt;BR /&gt;
            .SetVariable "DIMUPT", 0&lt;BR /&gt;
            .SetVariable "DIMFRAC", 0&lt;BR /&gt;
&lt;BR /&gt;
            'Dimstyle specific&lt;BR /&gt;
            Select Case DimstyleName&lt;BR /&gt;
                Case DIMSTYLE_FTFRAC&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 4&lt;BR /&gt;
                    .SetVariable "DIMDEC", 3&lt;BR /&gt;
                    .SetVariable "DIMALTD", 0&lt;BR /&gt;
                    .SetVariable "DIMALTF", 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_INFRAC&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMPOST", """"&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 5&lt;BR /&gt;
                    .SetVariable "DIMDEC", 3&lt;BR /&gt;
                    .SetVariable "DIMALTD", 0&lt;BR /&gt;
                    .SetVariable "DIMALTF", 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_FTDEC&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 3&lt;BR /&gt;
                    .SetVariable "DIMDEC", 2&lt;BR /&gt;
                    .SetVariable "DIMALTD", 0&lt;BR /&gt;
                    .SetVariable "DIMALTF", 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_INDEC&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMPOST", """"&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 2&lt;BR /&gt;
                    .SetVariable "DIMDEC", 2&lt;BR /&gt;
                    .SetVariable "DIMALTD", 0&lt;BR /&gt;
                    .SetVariable "DIMALTF", 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_MM0&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 2&lt;BR /&gt;
                    .SetVariable "DIMDEC", 0&lt;BR /&gt;
                    .SetVariable "DIMALTD", 2&lt;BR /&gt;
                    .SetVariable "DIMALTF", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_MM1&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 2&lt;BR /&gt;
                    .SetVariable "DIMDEC", 1&lt;BR /&gt;
                    .SetVariable "DIMALTD", 2&lt;BR /&gt;
                    .SetVariable "DIMALTF", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_MM2&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 2&lt;BR /&gt;
                    .SetVariable "DIMDEC", 2&lt;BR /&gt;
                    .SetVariable "DIMALTD", 2&lt;BR /&gt;
                    .SetVariable "DIMALTF", 1 / 25.4&lt;BR /&gt;
                    .SetVariable "DIMALTU", 2&lt;BR /&gt;
                    .SetVariable "DIMAPOST", ""&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_ANG&lt;BR /&gt;
                    .SetVariable "DIMLFAC", 1&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMUNIT", 2&lt;BR /&gt;
                    .SetVariable "DIMDEC", 1&lt;BR /&gt;
&lt;BR /&gt;
                Case DIMSTYLE_UNIT&lt;BR /&gt;
                    .SetVariable "DIMBLK1", "OPEN90"&lt;BR /&gt;
                    .SetVariable "DIMBLK2", "OPEN90"&lt;BR /&gt;
                    .SetVariable "DIMTSZ", 0&lt;BR /&gt;
                    .SetVariable "DIMASZ", 2.5&lt;BR /&gt;
                    .SetVariable "DIMPOST", ""&lt;BR /&gt;
                    .SetVariable "DIMTIX", 1&lt;BR /&gt;
                    .SetVariable "DIMTXT", 2&lt;BR /&gt;
                    .SetVariable "DIMTXSTY", UnitTextStyle.Name&lt;BR /&gt;
&lt;BR /&gt;
            End Select&lt;BR /&gt;
            Set objDimstyle = ThisDrawing.DimStyles.Add(DimstyleName)&lt;BR /&gt;
&lt;BR /&gt;
            objDimstyle.CopyFrom ThisDrawing&lt;BR /&gt;
        End With&lt;BR /&gt;
    End If&lt;BR /&gt;
    ThisDrawing.ActiveDimStyle = objDimstyle&lt;BR /&gt;
End Sub</description>
      <pubDate>Wed, 06 Jun 2001 09:54:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/creating-dimstyles/m-p/340353#M83644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2001-06-06T09:54:54Z</dc:date>
    </item>
  </channel>
</rss>

