<?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: MATCHING PARENTHESIS in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6558776#M128678</link>
    <description>&lt;P&gt;Thank You Sir!&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2016 10:59:15 GMT</pubDate>
    <dc:creator>vishshreevT578L</dc:creator>
    <dc:date>2016-09-13T10:59:15Z</dc:date>
    <item>
      <title>MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6554483#M128668</link>
      <description>&lt;PRE&gt;(defun CopyLayerColor2 (ent1 ent2 / elist1 elist2)&lt;FONT color="#3366FF"&gt;; the &lt;STRONG&gt;&lt;EM&gt;function&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
  (setq
    elist1 (entget ent1)&lt;FONT color="#3366FF"&gt;; entity data lists&lt;/FONT&gt;
    elist2 (entget ent2)
  )&lt;FONT color="#999999"&gt;; setq&lt;/FONT&gt;
  (setq elist2 (append elist2 (list (assoc 8 elist1))))&lt;FONT color="#3366FF"&gt;; assign ent1's Layer to ent2&lt;/FONT&gt;
  (setq elist2
    (append elist2 &lt;FONT color="#3366FF"&gt;; Color adjustment&lt;/FONT&gt;
      (if (assoc 62 elist1)&lt;FONT color="#3366FF"&gt;; ent1 has override [non-Bylayer] Color&lt;/FONT&gt;
        (list (assoc 62 elist1))&lt;FONT color="#3366FF"&gt;; then [give that to ent2]&lt;/FONT&gt;
        '((62 . 256))&lt;FONT color="#3366FF"&gt;; else [make ent2's Color ByLayer]&lt;/FONT&gt;
      )&lt;FONT color="#999999"&gt;; if&lt;/FONT&gt;
    )&lt;FONT color="#999999"&gt;; append&lt;/FONT&gt;
  )&lt;FONT color="#999999"&gt;; setq&lt;/FONT&gt;
  (entmod elist2)&lt;FONT color="#3366FF"&gt;; update properties of ent2&lt;/FONT&gt;
)&lt;FONT color="#999999"&gt;; defun&lt;/FONT&gt;

(defun C:CLC2 (/ en1 en2)&lt;FONT color="#3366FF"&gt;; = &lt;STRONG&gt;C&lt;/STRONG&gt;opy &lt;STRONG&gt;L&lt;/STRONG&gt;ayer &amp;amp; &lt;STRONG&gt;C&lt;/STRONG&gt;olor &lt;STRONG&gt;2&lt;/STRONG&gt; [whatever the 2 means]; the &lt;STRONG&gt;&lt;EM&gt;command&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
  (if
    (and
      (setq en1 (car (entsel "\nObject to copy Layer and Color FROM: ")))
      (setq en2 (car (entsel "\nObject to copy Layer and Color TO: ")))
    )&lt;FONT color="#999999"&gt;; and&lt;/FONT&gt;
    (CopyLayerColor2 en1 en2)&lt;FONT color="#3366FF"&gt;; apply those entities as arguments to the &lt;EM&gt;&lt;STRONG&gt;function&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;
  )&lt;FONT color="#999999"&gt;; if&lt;/FONT&gt;
  (princ)
)&lt;FONT color="#999999"&gt;; defun&lt;BR /&gt;&lt;BR /&gt;IN THE ABOVE EXAMPLE ALL THE PARENTHESIS ARE MATCHING RESPECTIVELY.&lt;BR /&gt;I WANT TO UNDERSTAND HOW IT IS DONE.&lt;BR /&gt;THANKS SIR (KENT) IN ADVANCE&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Sep 2016 12:40:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6554483#M128668</guid>
      <dc:creator>vishshreevT578L</dc:creator>
      <dc:date>2016-09-10T12:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6554593#M128669</link>
      <description>I use TextPad which has parenthesis matching by hitting Ctrl+M.</description>
      <pubDate>Sat, 10 Sep 2016 15:09:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6554593#M128669</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2016-09-10T15:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6554738#M128670</link>
      <description>&lt;P&gt;I use vlide. &amp;nbsp;Each time you hit a closing parenthesis it indicates the open parenthesis closed. &amp;nbsp;Double clicking in front of a parenthesis will select everthing it encloses.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 18:40:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6554738#M128670</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-09-10T18:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6555500#M128671</link>
      <description>&lt;P&gt;And I use Notepad2.exe, which 'colors' the matching parens,&lt;/P&gt;&lt;P&gt;when one is selected by a left mouse click.&lt;/P&gt;&lt;P&gt;I use the older version, 1.xx,&amp;nbsp; that includes the toolbar icons&lt;/P&gt;&lt;P&gt;for forward and reverse finds, avoiding the Find dialog box queries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2016 17:39:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6555500#M128671</guid>
      <dc:creator>stevor</dc:creator>
      <dc:date>2016-09-11T17:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556020#M128672</link>
      <description>&lt;PRE&gt;(defun CopyLayerColor2 (ent1 ent2 / elist1 elist2)&lt;FONT color="#3366FF"&gt;; the &lt;STRONG&gt;&lt;EM&gt;function&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
  &lt;U&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/U&gt;setq
    elist1 (entget ent1)&lt;FONT color="#3366FF"&gt;; entity data lists&lt;/FONT&gt;
    elist2 (entget ent2)
  &lt;U&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/U&gt;&lt;FONT color="#999999"&gt;; setq&lt;/FONT&gt;
  &lt;U&gt;(&lt;/U&gt;setq elist2 (append elist2 (list (assoc 8 elist1))))&lt;FONT color="#3366FF"&gt;; assign ent1's Layer to ent2&lt;/FONT&gt;
  &lt;U&gt;(&lt;/U&gt;setq elist2
    &lt;U&gt;(&lt;/U&gt;append elist2 &lt;FONT color="#3366FF"&gt;; Color adjustment&lt;/FONT&gt;
      &lt;U&gt;(&lt;/U&gt;if (assoc 62 elist1)&lt;FONT color="#3366FF"&gt;; ent1 has override [non-Bylayer] Color&lt;/FONT&gt;
        (list (assoc 62 elist1))&lt;FONT color="#3366FF"&gt;; then [give that to ent2]&lt;/FONT&gt;
        '((62 . 256))&lt;FONT color="#3366FF"&gt;; else [make ent2's Color ByLayer]&lt;/FONT&gt;
      &lt;U&gt;)&lt;/U&gt;&lt;FONT color="#999999"&gt;; if&lt;/FONT&gt;
    &lt;U&gt;)&lt;/U&gt;&lt;FONT color="#999999"&gt;; append&lt;/FONT&gt;
  &lt;U&gt;)&lt;/U&gt;&lt;FONT color="#999999"&gt;; setq&lt;/FONT&gt;
  (entmod elist2)&lt;FONT color="#3366FF"&gt;; update properties of ent2&lt;/FONT&gt;
)&lt;FONT color="#999999"&gt;; defun&lt;/FONT&gt;

(defun C:CLC2 (/ en1 en2)&lt;FONT color="#3366FF"&gt;; = &lt;STRONG&gt;C&lt;/STRONG&gt;opy &lt;STRONG&gt;L&lt;/STRONG&gt;ayer &amp;amp; &lt;STRONG&gt;C&lt;/STRONG&gt;olor &lt;STRONG&gt;2&lt;/STRONG&gt; [whatever the 2 means]; the &lt;STRONG&gt;&lt;EM&gt;command&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
  (if
    (and
      (setq en1 (car (entsel "\nObject to copy Layer and Color FROM: ")))
      (setq en2 (car (entsel "\nObject to copy Layer and Color TO: ")))
    )&lt;FONT color="#999999"&gt;; and&lt;/FONT&gt;
    (CopyLayerColor2 en1 en2)&lt;FONT color="#3366FF"&gt;; apply those entities as arguments to the &lt;EM&gt;&lt;STRONG&gt;function&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;
  )&lt;FONT color="#999999"&gt;; if&lt;/FONT&gt;
  (princ)
)&lt;FONT color="#999999"&gt;; defun&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sir i mean to say in the above example is what i have underlined now&lt;BR /&gt;for instance setq closing parenthesis ends in line vertically to setq, if to if, and to and etc.....&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Sep 2016 04:40:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556020#M128672</guid>
      <dc:creator>vishshreevT578L</dc:creator>
      <dc:date>2016-09-12T04:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556458#M128673</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While showing the closing parenthesis indented at the same level as the opening one is considered good style in C -like languages, in the mainstream Lisp culture (Common Lisp, Scheme) that is considered a waste of space. A professional CL programmer would indent your example like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun CopyLayerColor2 (ent1 ent2 / elist1 elist2); the function
  (setq elist1 (entget ent1); entity data lists
        elist2 (entget ent2))
  (setq elist2 (append elist2 (list (assoc 8 elist1)))); assign ent1's Layer to ent2
  (setq elist2
        (append elist2 ; Color adjustment
                (if (assoc 62 elist1); ent1 has override [non-Bylayer] Color
                    (list (assoc 62 elist1)); then [give that to ent2]
                    '((62 . 256))))); else [make ent2's Color ByLayer]
  (entmod elist2)); update properties of ent2


(defun C:CLC2 (/ en1 en2); = Copy Layer &amp;amp; Color 2 [whatever the 2 means]; the command
  (if
   (and
     (setq en1 (car (entsel "\nObject to copy Layer and Color FROM: ")))
     (setq en2 (car (entsel "\nObject to copy Layer and Color TO: "))))
   (CopyLayerColor2 en1 en2)); apply those entities as arguments to the function
  (princ))&lt;/PRE&gt;&lt;P&gt;That is easy to achieve with an editor that understands Lisp syntax; about 90 % of CL programmers use some variant of Emacs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 10:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556458#M128673</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2016-09-12T10:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556698#M128674</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4033493"&gt;@vishshreevT578L&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;FONT color="#999999"&gt;&lt;FONT color="#000000"&gt;....&lt;/FONT&gt;&lt;BR /&gt;IN THE ABOVE EXAMPLE ALL THE PARENTHESIS ARE MATCHING RESPECTIVELY.&lt;BR /&gt;I WANT TO UNDERSTAND HOW IT IS DONE.&lt;BR /&gt;THANKS SIR (KENT) IN ADVANCE&lt;/FONT&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It's all a matter of personal preference, but I&amp;nbsp;tend to put right parentheses, if they are &lt;EM&gt;not on the same line&lt;/EM&gt; as the left parentheses they go with,&amp;nbsp;at the same level of indentation, mostly&amp;nbsp;because:&lt;/P&gt;
&lt;P&gt;A)&amp;nbsp; I find it easier to "see what's going on" than in the "mainstream" Common Lisp practice mentioned by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/569672"&gt;@martti.halminen&lt;/a&gt;&amp;nbsp;in Post 6; and&lt;/P&gt;
&lt;P&gt;B)&amp;nbsp; Many [though certainly not all] examples in the AutoLisp Reference do it this way, for example the entry about &lt;A href="http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-3B8BB020-1E1A-4FA3-B7B3-B5B20BA04CD9" target="_self"&gt;(lambda)&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just do it manually, with two spaces per level of indentation.&amp;nbsp; Many people use tabs, which is too much indentation for my taste, and often requires one&amp;nbsp;to scroll to see the end of a line of code when that would not be necessary with less extreme indentations.&amp;nbsp; One space doesn't seem to be enough for&amp;nbsp;visible differentiation [again, to &lt;EM&gt;my&lt;/EM&gt; eye].&amp;nbsp; No indentation is &lt;EM&gt;required&lt;/EM&gt; at all, functionally, so do what you prefer.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 12:49:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556698#M128674</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-09-12T12:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556997#M128675</link>
      <description>&lt;P&gt;Also.. in the VLIDE you can go to Tools&amp;gt;Format Code&amp;nbsp;in Editor or Ctrl+Alt+F. &amp;nbsp;End result on your code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VLIDE Format Code.JPG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/272180iD58BF411A94B56B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="VLIDE Format Code.JPG" alt="VLIDE Format Code.JPG" /&gt;&lt;/span&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't like how it does the comments, but other than that it generally gets me to a format I like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Since you asked I just found that you can also edit these format options with Tools&amp;gt;Environment Options&amp;gt;Visual LISP Formatting Options. Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Format Options.png" style="width: 320px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/272181i078A62C1A66E710D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Format Options.png" alt="Format Options.png" /&gt;&lt;/span&gt;﻿&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 14:43:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6556997#M128675</guid>
      <dc:creator>Shneuph</dc:creator>
      <dc:date>2016-09-12T14:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6557171#M128676</link>
      <description>My favourite tool for formatting is &lt;BR /&gt;VLIDE &amp;gt;&amp;gt; Edit / Extra commands / Indent to Current Level.</description>
      <pubDate>Mon, 12 Sep 2016 15:35:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6557171#M128676</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-09-12T15:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6557892#M128677</link>
      <description>I don't want to sound overly defensive, but I also like TextPad because of&lt;BR /&gt;colorized syntax (thanks to Michael Puckett) and the ability to set tabs at&lt;BR /&gt;2 (or whatever) spaces while at the same time automatically translating&lt;BR /&gt;tabs to spaces. Plus I can work on multiple lisp files without running&lt;BR /&gt;AutoCAD and without the VLIDE environment.&lt;BR /&gt;&lt;BR /&gt;I guess the funniest thing is that I still use ZTree to find, search, view,&lt;BR /&gt;rename, copy, and open files. I was a CAD Manager dating back to DOS days,&lt;BR /&gt;and every app we used we ran from XTree complete with maintaining a dwg&lt;BR /&gt;history (though that was via AutoLisp). The users weren't really aware&lt;BR /&gt;that I could track how much time they wasted (er, uh, spent) on a drawing&lt;BR /&gt;or who created "that" dwg. It could probably still work, but I haven't&lt;BR /&gt;bothered with it since my unwilling retirement.</description>
      <pubDate>Mon, 12 Sep 2016 21:27:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6557892#M128677</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2016-09-12T21:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: MATCHING PARENTHESIS</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6558776#M128678</link>
      <description>&lt;P&gt;Thank You Sir!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 10:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/matching-parenthesis/m-p/6558776#M128678</guid>
      <dc:creator>vishshreevT578L</dc:creator>
      <dc:date>2016-09-13T10:59:15Z</dc:date>
    </item>
  </channel>
</rss>

