<?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: inset block using lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985814#M65707</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;((findfile (strcat (getvar 'dwgprefix) "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg")))&lt;BR /&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I agree, that's the problem line -- the drawing prefix has a drive letter and file path already, so concatenating it onto the front of your "X:\\..." string will give you an invalid path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it isn't necessary to &lt;EM&gt;repeat&lt;/EM&gt; the whole path and drawing name.&amp;nbsp; The (findfile) function returns all of that if it finds the file, and being &lt;EM&gt;not nil&lt;/EM&gt;, it will be returned by that condition.&amp;nbsp; So this is all you need for the second condition:&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;((findfile "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg"))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;....&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 21:44:00 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2021-01-07T21:44:00Z</dc:date>
    <item>
      <title>inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985600#M65702</link>
      <description>&lt;P&gt;Hi im trying to make a lisp that inserts a block with a preset path so I don't have to look through my files every time to insert this block I use a lot. this is what I have so far but, I cant seem to get it right.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(DEFUN C:erosion10 ( / block_name)&lt;/P&gt;&lt;P&gt;(setq block_name&lt;BR /&gt;(cond&lt;BR /&gt;((tblsearch "block" "erosion 10") "erosion 10")&lt;BR /&gt;((findfile (strcat (getvar 'dwgprefix) "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg")))&lt;BR /&gt;(T nil)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(if block_name&lt;BR /&gt;(command "_insert" block_name)&lt;BR /&gt;(princ "\nblock name 'erosion 10' not found. ")&lt;BR /&gt;)&lt;BR /&gt;(PRINC)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 19:57:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985600#M65702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-07T19:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985663#M65703</link>
      <description>FYI you do know that if you add that folder location to your AutoCAD's default Search paths in OPTIONS&amp;gt;FILES tab, top most entry, you only ever have to use the block name to INSERT it to use.&lt;BR /&gt;&lt;BR /&gt;You can also INSERT that blocks (and others) from ADCENTER if you set that folder to be "home".&lt;BR /&gt;&lt;BR /&gt;You can also create a ToolPalette for all of the blocks in that folder (or just the one(s) you want) from ADCENTER then just drag and drop all day long too.&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Thu, 07 Jan 2021 20:26:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985663#M65703</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2021-01-07T20:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985681#M65704</link>
      <description>&lt;P&gt;The findfile line is somehow wrong.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:Erosion10 ( / block_name)

  (if (setq block_name
	     (cond ((tblsearch "block" "erosion 10") "erosion 10")
		   ((findfile "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg") "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg")
		   (nil)))
    (command "_insert" block_name)
    (princ "\nError: block 'erosion 10' not found. ")
    )
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 20:34:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985681#M65704</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-01-07T20:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985766#M65705</link>
      <description>&lt;P&gt;oh I see thank you for your help&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 21:19:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985766#M65705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-07T21:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985776#M65706</link>
      <description>&lt;P&gt;I actually didn't know this thanks you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/37212"&gt;@pendean&lt;/a&gt;. MY goal is still a lisp though because I want to share it with a few people and this will be easier I think. thanks&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 21:22:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985776#M65706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-07T21:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985814#M65707</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;((findfile (strcat (getvar 'dwgprefix) "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg")))&lt;BR /&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I agree, that's the problem line -- the drawing prefix has a drive letter and file path already, so concatenating it onto the front of your "X:\\..." string will give you an invalid path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it isn't necessary to &lt;EM&gt;repeat&lt;/EM&gt; the whole path and drawing name.&amp;nbsp; The (findfile) function returns all of that if it finds the file, and being &lt;EM&gt;not nil&lt;/EM&gt;, it will be returned by that condition.&amp;nbsp; So this is all you need for the second condition:&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;((findfile "X:\\Justin Gonzalez\\blocks\\erosion 10.dwg"))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;....&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 21:44:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9985814#M65707</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-01-07T21:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: inset block using lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9987313#M65708</link>
      <description>&lt;P&gt;Thanks, just what I've been needing for a long time !&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 13:48:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/inset-block-using-lisp/m-p/9987313#M65708</guid>
      <dc:creator>stevo1966</dc:creator>
      <dc:date>2021-01-08T13:48:20Z</dc:date>
    </item>
  </channel>
</rss>

