<?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 Re: Edit Dimension Properties or Change Dimension Style in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759601#M109070</link>
    <description>&lt;P&gt;Look into the &lt;STRONG&gt;DIMOVERRIDE&lt;/STRONG&gt; command.&amp;nbsp; You get to specify any number of properties to override, the value to put in each, and [after Enter when done specifying those] finally the Dimension(s) that you want to apply those overrides to.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "_.dimoverride" "DIMLUNIT" "2" "DIMLFAC" "50" "" (entlast) "")&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2018 17:34:13 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2018-02-07T17:34:13Z</dc:date>
    <item>
      <title>Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759516#M109069</link>
      <description>&lt;P&gt;Surprisingly, I can't seem to find much on this issue. I would like to change some of the properties of the last dimension that was created in my lsp. The default style is not what I need and should not be changed for this drawing. I only need to change some properties of the few dimensions that I create.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I cannot change the properties, then if it is easier to create an alternate dimstyle in my template and APPLY that to the last dimension drawn, then I am open to that also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how to code this? I'll add some sample code of what I'm looking for. I'm sure it probably isn't so easy. Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Change last dimension properties;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq LastDim (entlast))
(setq MyScale 50.00)
(command "chprop" LastDim "Dim Units" "Decimal" "Dim scale linear" MyScale "")

;;;;;;;;;;;;;;;;;;;;OR Change last dim DimStyle;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq LastDim (entlast))
(command "ChStyle" LastDim "MyStyle")&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2018 17:06:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759516#M109069</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-07T17:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759601#M109070</link>
      <description>&lt;P&gt;Look into the &lt;STRONG&gt;DIMOVERRIDE&lt;/STRONG&gt; command.&amp;nbsp; You get to specify any number of properties to override, the value to put in each, and [after Enter when done specifying those] finally the Dimension(s) that you want to apply those overrides to.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(command "_.dimoverride" "DIMLUNIT" "2" "DIMLFAC" "50" "" (entlast) "")&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 17:34:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759601#M109070</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-02-07T17:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759677#M109071</link>
      <description>&lt;P&gt;Kent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EXACTLY what I was looking for, much appreciated! Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~D&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 17:48:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7759677#M109071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-07T17:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7760746#M109072</link>
      <description>Lets look at it without using ENTLAST.&lt;BR /&gt;&lt;BR /&gt;Assuming the user has successfully selected 3 points for the dim command...&lt;BR /&gt;&lt;BR /&gt;(if (and p1 p2 p3)&lt;BR /&gt; (progn&lt;BR /&gt;  (foreach x (setq a (list "DIMLUNIT" "DIMLFAC"))&lt;BR /&gt;   (setq b (cons (getvar x) b))&lt;BR /&gt;  );foreach&lt;BR /&gt;  (setvar (nth 0 a) 2)&lt;BR /&gt;  (setvar (nth 1 a) 50)&lt;BR /&gt;  (command dim... p1 p2 p3 "exit")&lt;BR /&gt;  ;one can use -DIMSTYLE "Restore" method here [and skip the foreach part] or&lt;BR /&gt;  (setq n 0 b (reverse b))&lt;BR /&gt;  (repeat (length a)&lt;BR /&gt;   (setvar (nth n a) (nth n b))&lt;BR /&gt;   (setq n (1+ n))&lt;BR /&gt;  );repeat&lt;BR /&gt; );progn&lt;BR /&gt;);if&lt;BR /&gt;;*untested*&lt;BR /&gt;&lt;BR /&gt;This works well when there are 5 or more variables to 'temporarily' set.&lt;BR /&gt;The variables to temporarily set would only have to be written once using this structure.&lt;BR /&gt;There are other methods to write this...&lt;BR /&gt;&lt;BR /&gt;???&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Feb 2018 23:49:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7760746#M109072</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2018-02-07T23:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7762554#M109073</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/43171"&gt;@scot-65&lt;/a&gt; wrote:&lt;BR /&gt;....&lt;BR /&gt;&amp;nbsp;(foreach x (setq a (list "DIMLUNIT" "DIMLFAC"))&lt;BR /&gt; (setq b (cons (getvar x) b))&lt;BR /&gt; );foreach&lt;BR /&gt; (setvar (nth 0 a) 2)&lt;BR /&gt; (setvar (nth 1 a) 50)&lt;BR /&gt;....&lt;BR /&gt;(setq n 0 b (reverse b))&lt;BR /&gt; (repeat (length a)&lt;BR /&gt; (setvar (nth n a) (nth n b))&lt;BR /&gt; (setq n (1+ n))&lt;BR /&gt; );repeat&lt;BR /&gt;&amp;nbsp;....&lt;BR /&gt;The variables to temporarily set would only have to be written once using this structure.&lt;BR /&gt;....&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't see&amp;nbsp;any advantage to an approach like that.&amp;nbsp; The code in Post 2 also writes each variable only once.&amp;nbsp; And because it imposes the value for&amp;nbsp;each property on the selected Dimension(s), &lt;EM&gt;without changing the System Variable settings&lt;/EM&gt;, it doesn't require saving the settings first and resetting them afterwards, which is the main reason for the great difference in the amount of code involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you wanted for some reason to change those settings before drawing the Dimension(s) and restore them afterwards, it can be done more concisely without the (foreach) and (repeat) and (nth)&amp;nbsp;and index-counter elements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq
  dimvars '(dimlunit dimlfac) &lt;FONT color="#33cccc"&gt;;; and as many others as desired
&lt;/FONT&gt;  oldvals (mapcar 'getvar dimvars) &lt;FONT color="#33cccc"&gt;;; current settings&lt;/FONT&gt;
)&lt;FONT color="#999999"&gt;; setq
&lt;/FONT&gt;(mapcar 'setvar dimvars '(2 50)) &lt;FONT color="#33cccc"&gt;;; and as many others as desired, corresponding to items in 'dimvars' list
&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;.... draw the Dimension(s) ....
&lt;/FONT&gt;(mapcar 'setvar dimvars oldvals) &lt;FONT color="#33cccc"&gt;;; restore settings&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, I would be inclined instead to just&amp;nbsp;&lt;EM&gt;make a Dimension Style with the desired properties&lt;/EM&gt;, and &lt;EM&gt;use that&lt;/EM&gt;&amp;nbsp; to draw the Dimensions, rather than to impose a regular collection of overrides on Dimensions that were drawn using some Style that &lt;EM&gt;doesn't&lt;/EM&gt;&amp;nbsp; have all the desired properties.&amp;nbsp; But maybe the OP has some reason for doing it that way that I don't have the imagination to think of....&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:14:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7762554#M109073</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-02-08T15:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7764092#M109074</link>
      <description>There are some instances to apply overrides in lieu of creating&lt;BR /&gt;totally unique dimension styles. One example is to replace the&lt;BR /&gt;architectural tic when applying angular or radius dimensions.&lt;BR /&gt;&lt;BR /&gt;The OP is new to this community and we, as members, provide&lt;BR /&gt;insight to view processes more than one way (this example to&lt;BR /&gt;bypass commands).&lt;BR /&gt;&lt;BR /&gt;I'm still a little foggy with mapcar (and vla), and did not consider this.&lt;BR /&gt;Your snippet has been placed in an ever growing folder of good&lt;BR /&gt;ideas found on this forum...&lt;BR /&gt;&lt;BR /&gt;scot-65&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Feb 2018 23:56:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7764092#M109074</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2018-02-08T23:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7764238#M109075</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/43171"&gt;@scot-65&lt;/a&gt; wrote:&lt;BR /&gt;There are some instances to apply overrides in lieu of creating totally unique dimension styles. One example is to replace the architectural tic when applying angular or radius dimensions.&lt;BR /&gt;....&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Absolutely.&amp;nbsp; But I do think that if you have a specific combination of overrides that you use often enough to want to &lt;EM&gt;build them into a routine&lt;/EM&gt;, it may be better to define a Style instead.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 01:42:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7764238#M109075</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-02-09T01:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Dimension Properties or Change Dimension Style</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7765859#M109076</link>
      <description>&lt;P&gt;You both have provided GREAT input for this. thank you so much. My reason for OVERRIDE in this case is that It is for one template we are using for this project, and I do not have permissions to save over the template. so I would have to create a new dimstyle each time I started a new project with this template (would be frequent). I love the fact of storing the old variables, using new ones and restoring them. It seems much more efficient than using a (COMMAND "DIMOVERRIDE...). Any second spared while running codes is useful. I am new to the game and appreciate all of the useful info! Both of you have provided more than enough for me to chew on and move forward with. Thank you again&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 15:52:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-dimension-properties-or-change-dimension-style/m-p/7765859#M109076</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-09T15:52:10Z</dc:date>
    </item>
  </channel>
</rss>

