<?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: Change Block Visibility depending on File Name using LISP in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272622#M23521</link>
    <description>&lt;P&gt;are the file names and visibility states supposed to be like ones in quotes?&lt;/P&gt;&lt;P&gt;File Name: "01[.dwg]" - Visibility: "First Floor"&lt;BR /&gt;File Name: "02[.dwg]" - Visibility: "Second Floor"&lt;BR /&gt;File Name: "03[.dwg]" - Visibility: "Third Floor"&lt;BR /&gt;File Name: "04[.dwg]" - Visibility: "Fourth Floor"&lt;BR /&gt;...&lt;BR /&gt;File Name: "10[.dwg]" - Visibility: "Tenth Floor"&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 13:37:04 GMT</pubDate>
    <dc:creator>komondormrex</dc:creator>
    <dc:date>2023-09-28T13:37:04Z</dc:date>
    <item>
      <title>Change Block Visibility depending on File Name using LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272308#M23518</link>
      <description>&lt;P&gt;Good morning. Would anyone know of a lisp which is easily adjustable to add multiple outcomes for this request:&lt;BR /&gt;&lt;BR /&gt;I am needing a lisp which will update a dynamic-visibility block (which has 10 different visibilities), which I change depending on the file name&lt;BR /&gt;&lt;BR /&gt;File Name: 01 - Visibility: First Floor&amp;nbsp;&lt;/P&gt;&lt;P&gt;File Name: 02 - Visibility: Second Floor&amp;nbsp;&lt;/P&gt;&lt;P&gt;File Name: 03 - Visibility: Third Floor&amp;nbsp;&lt;/P&gt;&lt;P&gt;File Name: 04 - Visibility: Fourth Floor etc...&lt;BR /&gt;&lt;BR /&gt;I have a lisp I recieved from LeeMac which allows me to manually adjust a blocks visibility which is super useful, I only use the first portion of said lisp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone could help me merge this into a lisp which detects a file name and changes the visibility depending on this, then my titleblocks will be nearly fully automatic and save so much time and error.&lt;BR /&gt;&lt;BR /&gt;(defun c:changevis-BLOCKNAME ( / blk idx obj sel vis )&lt;BR /&gt;&lt;BR /&gt;(setq blk "BLOCK" ;; Block Name&lt;BR /&gt;vis "VISIBILITY" ;; New Visibility State&lt;BR /&gt;)&lt;BR /&gt;(if (setq sel (ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`*U*," blk)) '(410 . "~Model"))))&lt;BR /&gt;(repeat (setq idx (sslength sel))&lt;BR /&gt;(if (= (strcase blk) (strcase (LM:blockname (setq obj (vlax-ename-&amp;gt;vla-object (ssname sel (setq idx (1- idx))))))))&lt;BR /&gt;(LM:SetVisibilityState obj vis)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 10:27:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272308#M23518</guid>
      <dc:creator>kieran.leadbetter</dc:creator>
      <dc:date>2023-09-28T10:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change Block Visibility depending on File Name using LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272352#M23519</link>
      <description>&lt;P&gt;Just use some functions from&amp;nbsp;&amp;nbsp;&lt;A href="https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-8543549B-F0D7-43CD-87A3-F6B827FF0B88" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt;&amp;nbsp;list to extract the visibility name for the filename and save it to the vis variable on the 4th line of the code. You know little of DIESEL... so that won't be too difficult for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vis (substr.... (getvar 'dwgname) ....&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 10:58:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272352#M23519</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-09-28T10:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change Block Visibility depending on File Name using LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272401#M23520</link>
      <description>&lt;P&gt;&lt;SPAN&gt;(strcat "`*U*," blk) will find differentdynamic&amp;nbsp; blocks not just the name of the one you want to change, as its dynamic you need to go through the *Uxx blocks and look at their effective names if they match blk then change the visibilty.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; loop through selection set and if name is "*U..." 
(if (and (vlax-property-available-p blk 'effectivename)
    (= (vla-get-effectivename blk) "yourblockname"))
(do something)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Sep 2023 11:25:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272401#M23520</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-09-28T11:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change Block Visibility depending on File Name using LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272622#M23521</link>
      <description>&lt;P&gt;are the file names and visibility states supposed to be like ones in quotes?&lt;/P&gt;&lt;P&gt;File Name: "01[.dwg]" - Visibility: "First Floor"&lt;BR /&gt;File Name: "02[.dwg]" - Visibility: "Second Floor"&lt;BR /&gt;File Name: "03[.dwg]" - Visibility: "Third Floor"&lt;BR /&gt;File Name: "04[.dwg]" - Visibility: "Fourth Floor"&lt;BR /&gt;...&lt;BR /&gt;File Name: "10[.dwg]" - Visibility: "Tenth Floor"&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 13:37:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-visibility-depending-on-file-name-using-lisp/m-p/12272622#M23521</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-09-28T13:37:04Z</dc:date>
    </item>
  </channel>
</rss>

