<?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 Script to -INSERT a block in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054011#M8535</link>
    <description>&lt;P&gt;Trying to -INSERT a "ARROW" block with a script&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;-insert arrow 3263923.0305,1263407.6526&amp;nbsp;&amp;nbsp; 246.7&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when copy on command line it says&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arshadmirza786_0-1727681263368.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1415892i62F36AC03F1D1916/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arshadmirza786_0-1727681263368.png" alt="arshadmirza786_0-1727681263368.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to overcome this "Substitute block name" dialoge box and run the SCRIPT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2024 07:31:06 GMT</pubDate>
    <dc:creator>arshadmirza786</dc:creator>
    <dc:date>2024-09-30T07:31:06Z</dc:date>
    <item>
      <title>Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054011#M8535</link>
      <description>&lt;P&gt;Trying to -INSERT a "ARROW" block with a script&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;-insert arrow 3263923.0305,1263407.6526&amp;nbsp;&amp;nbsp; 246.7&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when copy on command line it says&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arshadmirza786_0-1727681263368.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1415892i62F36AC03F1D1916/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arshadmirza786_0-1727681263368.png" alt="arshadmirza786_0-1727681263368.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to overcome this "Substitute block name" dialoge box and run the SCRIPT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 07:31:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054011#M8535</guid>
      <dc:creator>arshadmirza786</dc:creator>
      <dc:date>2024-09-30T07:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054323#M8536</link>
      <description>&lt;P&gt;I've had similar issues with resurrecting old blocks I find on shared drives. My issues were mostly because of weird characters that were used in the file name or even spaces (which I suspect may be the case here).&amp;nbsp; More info on your dialog box can be found here&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Error-message-The-file-you-have-chosen-cannot-be-used-as-a-block-name-or-is-greater-than-8-characters-while-loading-XREF-in-AutoCAD.html" target="_blank"&gt;https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Error-message-The-file-you-have-chosen-cannot-be-used-as-a-block-name-or-is-greater-than-8-characters-while-loading-XREF-in-AutoCAD.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dived into your drawing and while there is a block called "ARROW" it is nested within another block. The top level block has a random string assigned to it. You have a few options. Assuming that the file you shared is the one your pulling the block from, open that file, select the block and use "EXPLODE". It should still come up as a block when you check the properties pallet but the name will now read "ARROW". Perform the "PURGE" command and purge all unused block references which should have that random string named block listed. Save the drawing and you should now be good to go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option is to get a new file and create the block from scratch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Keep me posted about your results.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 10:09:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054323#M8536</guid>
      <dc:creator>ryanatkins49056</dc:creator>
      <dc:date>2024-09-30T10:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054526#M8537</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arshadmirza786_0-1727696639791.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1415986i5DD99AD53CE73F07/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arshadmirza786_0-1727696639791.png" alt="arshadmirza786_0-1727696639791.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks for a good advise but sotion is same&lt;/P&gt;&lt;P&gt;if u see the command line after writing arrow, it does not goto next line to get the coordinates&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think thats problem&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 11:48:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054526#M8537</guid>
      <dc:creator>arshadmirza786</dc:creator>
      <dc:date>2024-09-30T11:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054572#M8538</link>
      <description>&lt;P&gt;Assuming the 246.7 is rotation try lisp code&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(command "-insert" "arrow" 3263923.0305,1263407.6526 "" "" 246.7)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 30 Sep 2024 12:05:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054572#M8538</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-09-30T12:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054589#M8539</link>
      <description>&lt;P&gt;Another thing to try is surround the name of block with quotes&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;-insert "arrow" 3263923.0305,1263407.6526 1 1 246.7 &lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 30 Sep 2024 12:12:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054589#M8539</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-09-30T12:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054598#M8540</link>
      <description>&lt;P&gt;Coordinates, Rotation angle Data is in a EXCEL File&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to call excel cells in this line , as these a 100s line Excel sheet&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 12:17:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054598#M8540</guid>
      <dc:creator>arshadmirza786</dc:creator>
      <dc:date>2024-09-30T12:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054624#M8541</link>
      <description>&lt;P&gt;Include a sample excel file so others here can jump in to come up with code to read each line and insert into AutoCAD. Also you can open excel file do a find and replace arrow with “arrow” and try copy and paste then&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 12:27:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054624#M8541</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-09-30T12:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054637#M8542</link>
      <description>&lt;P&gt;If this is a &lt;STRONG&gt;Script&lt;/STRONG&gt;, then &lt;STRONG&gt;use Enter to a new line&lt;/STRONG&gt; after the "arrow" Block name, rather than a space.&amp;nbsp; &lt;EM&gt;Block names can contain spaces&lt;/EM&gt; [there was a time when they could not, which I thought was better], and those are honored in a Script, so it thinks your coordinates etc. are part of the intended Block name, which therefore includes characters not allowed in Block names [see Help about the &lt;STRONG&gt;-&lt;/STRONG&gt;BLOCK command and the EXTNAMES System Variable].&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 12:58:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13054637#M8542</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-09-30T12:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056360#M8543</link>
      <description>&lt;P&gt;Pls look in xls file&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pline column works perfect but -INSERT does not work as explained earlier&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 05:49:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056360#M8543</guid>
      <dc:creator>arshadmirza786</dc:creator>
      <dc:date>2024-10-01T05:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056413#M8544</link>
      <description>&lt;P&gt;Copy &amp;amp; pasting the &lt;STRONG&gt;PLINE&lt;/STRONG&gt; command works because the coordinates are what's requested immediately following the command sequence:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;pline 3263923.0305,1263407.6526 @14.184&amp;lt;-156.7 &lt;/LI-CODE&gt;&lt;P&gt;But when it comes to the &lt;STRONG&gt;INSERT&lt;/STRONG&gt; command (assuming your drawing does have a block named "&lt;STRONG&gt;arrow&lt;/STRONG&gt;") since &lt;STRONG&gt;AutoCAD&lt;/STRONG&gt; supports &lt;U&gt;long file names&lt;/U&gt; which includes &lt;U&gt;spaces&lt;/U&gt; it does not know when the block name ends.&lt;/P&gt;&lt;P&gt;This is why the Insert line from your Excel file does not work.&amp;nbsp;AutoCAD thinks you want to insert a block name that includes all those numbers following arrow:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;-insert arrow 3263923.0305,1263407.6526 -156.7 &lt;/LI-CODE&gt;&lt;P&gt;The way to do this is to use lisp which surrounds the block name along with the other entries with quotes like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(command "insert" "arrow" "3263923.0305,1263407.6526" "1" "1" "-156.7")&lt;/LI-CODE&gt;&lt;P&gt;Now in a Script file the way to make it work would be to separate each entry into a different line like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;-insert
arrow
3263923.0305,1263407.6526
1
1
-156.7&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 06:23:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056413#M8544</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-10-01T06:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056482#M8545</link>
      <description>&lt;P&gt;How to WRITE in EXCEL cell ???&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR is there a SYSTEM VERIABLE to change the LONG FILE NAME to a old short names&lt;/P&gt;&lt;P&gt;so acad not use a long name&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 07:05:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056482#M8545</guid>
      <dc:creator>arshadmirza786</dc:creator>
      <dc:date>2024-10-01T07:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056539#M8546</link>
      <description>&lt;P&gt;No variable that I'm aware of to force AutoCAD to only take short block names.&lt;/P&gt;&lt;P&gt;As for Excel, you can enter the cell like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;="(command ""-insert"" ""arrow"" """&amp;amp;$G6&amp;amp;","&amp;amp;$H6&amp;amp;""" ""1"" ""1"" "&amp;amp;$F6&amp;amp;")"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="paullimapa_3-1727768384709.png" style="width: 863px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1416339i3553BAA3BF73725B/image-dimensions/863x229?v=v2" width="863" height="229" role="button" title="paullimapa_3-1727768384709.png" alt="paullimapa_3-1727768384709.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 07:40:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056539#M8546</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-10-01T07:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056603#M8547</link>
      <description>&lt;P&gt;There is 2 ways to do this write a macro in excel that has 2 function do a pline and insert a block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second for me is read the cells direct from excel and draw the pline then add the block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In saying above there is a draw pline with arrow head it uses the method of changing the pline width as you construct the 2 part pline. Much easier than having 2 objects. It uses, pline startpt w 0 0 nextpoint w arrowsize 0 next point. Try it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SeaHaven_0-1727770902585.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1416352iB89C9BDB4FD8FF4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_0-1727770902585.png" alt="SeaHaven_0-1727770902585.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Added to "my to do" will read direct excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 08:24:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056603#M8547</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-10-01T08:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056664#M8548</link>
      <description>&lt;P&gt;The ACAD says&lt;/P&gt;&lt;P&gt;Command: (command "-insert" "arrow" "3263961.1069,1263279.6398" "1" "1" -211)&lt;BR /&gt;-insert Enter block name or [?] &amp;lt;arrow&amp;gt;: arrow Specify insertion point or [Basepoint/Scale/X/Y/Z/Rotate/Explode/REpeat]: 3263961.1069,1263279.6398&lt;BR /&gt;Enter X scale factor, specify opposite corner, or [Corner/XYZ] &amp;lt;1&amp;gt;: 1 Enter Y scale factor &amp;lt;use X scale factor&amp;gt;: 1&lt;BR /&gt;Specify rotation angle &amp;lt;0&amp;gt;: -211&lt;BR /&gt;Command: nil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTHING on screen to show&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 08:58:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056664#M8548</guid>
      <dc:creator>arshadmirza786</dc:creator>
      <dc:date>2024-10-01T08:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056737#M8549</link>
      <description>&lt;P&gt;Did you read what I posted ? Don't need a arrow block. I just need time working on some thing else at moment.&lt;/P&gt;&lt;P&gt;Copy and paste this to command line into a blank dwg, zoom in around 0,0 and should see a arrow pline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(command "pline" "0,0" "w" 0 0 "100,0" "w" 5 0 "110,0" "")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change the variable 5 that is arrow head size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the info is in the Excel file just have it open before running a lisp that reads the cells. Watch this space.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 09:46:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056737#M8549</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-10-01T09:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056916#M8550</link>
      <description>&lt;P&gt;Try this, just open the excel, load the program, select the range, go back to CAD should be done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/td-p/13054011


((defun c:wow ( / myxl oldsnap ahead x val pt dist ang pt2 pt3)

(defun dtr (a)
(* pi (/ a 180.0))
)


; Alpha2Number - Converts Alpha string into Number
; Function By: Gilles Chanteau from Marseille, France
; Arguments: 1
;   Str$ = String to convert
; Syntax example: (Alpha2Number "ABC") = 731
;-------------------------------------------------------------------------------
(defun Alpha2Number (Str$ / Num#)
  (if (= 0 (setq Num# (strlen Str$)))
    0
    (+ (* (- (ascii (strcase (substr Str$ 1 1))) 64) (expt 26 (1- Num#)))
       (Alpha2Number (substr Str$ 2))
    )
  )
)

; ColumnRow - Returns a list of the Column and Row number
; Function By: Gilles Chanteau from Marseille, France
; Arguments: 1
;   Cell$ = Cell ID
; Syntax example: (ColumnRow "ABC987") = '(731 987)
;default to "A1" if there's a problem
;-------------------------------------------------------------------------------
(defun ColumnRow (Cell$ / Column$ Char$ Row#)
  (setq Column$ "")
  (while (&amp;lt; 64 (ascii (setq Char$ (strcase (substr Cell$ 1 1)))) 91)
    (setq Column$ (strcat Column$ Char$)
          Cell$ (substr Cell$ 2)
    )
  )
  (if (and (/= Column$ "") (numberp (setq Row# (read Cell$))))
    (list (Alpha2Number Column$) Row#)
    '(1 1)
  )
)


; Number2Alpha - Converts Number into Alpha string
; Function By: Gilles Chanteau from Marseille, France
; Arguments: 1
;   Num# = Number to convert
; Syntax example: (Number2Alpha 731) = "ABC"
;-------------------------------------------------------------------------------
(defun Number2Alpha (Num# / Val#)
  (if (&amp;lt; Num# 27)
    (chr (+ 64 Num#))
    (if (= 0 (setq Val# (rem Num# 26)))
      (strcat (Number2Alpha (1- (/ Num# 26))) "Z")
      (strcat (Number2Alpha (/ Num# 26)) (chr (+ 64 Val#)))
    )
  )
);defun Number2Alpha

; thanks to Lee-mac for this defun 
; www.lee-mac.com
; 44 is comma 9 is tab 34 is space 58 is colon
(defun _csv-&amp;gt;lst58 ( str / pos )
	(if (setq pos (vl-string-position 58 str))
		(cons (substr str 1 pos) (_csv-&amp;gt;lst58 (substr str (+ pos 2))))
		(list str)
    )
)

; this code was done by the great FIXO
; no longer with us
(defun getrangexl2 ( / lst UR CR RADD )
(vl-catch-all-error-p
	   (setq Rng
		  (vl-catch-all-apply
		    (function (lambda ()
				(vlax-variant-value
				  (vlax-invoke-method
				    (vlax-get-property myxl 'Application)
				    'Inputbox
				    "Select a Range: "
				    "Range Selection "
				    nil
				    nil
				    nil
				    nil
				    nil
				    8))))))
)
(setq xrng (vlax-get-property rng "address"))
(setq xxrng xrng)
(repeat 4 (setq xxrng(vl-string-subst "" "$" xxrng)))
(setq xxxrng (_csv-&amp;gt;lst58 xxrng))
(setq rngst (columnrow (nth 0 xxxrng)) rngend (columnrow (nth 1 xxxrng)))
(setq *ExcelData@ nil )
(setq Row# (nth 1 rngst))
(repeat (+ (- (nth 1 rngend)(nth 1 rngst) ) 1)
(setq Data@ nil)
(setq Column# (nth 0 rngst))
(repeat (+  (- (nth  0 rngend)(nth 0 rngst) ) 1)
(setq Range$ (strcat (Number2Alpha Column#)(itoa Row#)))
(setq ExcelRange (vlax-get-property myxl "Range" range$))
(setq ExcelVariant (vlax-get-property ExcelRange 'Value))
(setq ExcelValue (vlax-variant-value ExcelVariant))
(setq Data@ (append Data@ (list ExcelValue)))
(setq Column# (1+ Column#))
)
(setq *ExcelData@ (append *ExcelData@ (list Data@)))
(setq Row# (1+ Row#))
)
(princ *ExcelData@)
(princ)
)

(or (setq myxl (vlax-get-object "Excel.Application"))
    (setq myxl (vlax-get-or-create-object "excel.Application"))
)
(vla-put-visible myXL :vlax-true)
(vlax-put-property myxl 'ScreenUpdating :vlax-true)
(vlax-put-property myXL 'DisplayAlerts :vlax-true)

(alert "Select the range of values start at say A6 end IX \n\n dont include average \n Press ok. then go to Excel")
(getrangexl2)

(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)

(setq ahead 1 x 1)
(foreach val *ExcelData@
(princ (setq x (1+ x)))
(setq pt (list (nth 6 val) (nth 7 val)))
(setq dist (nth 3 val) ang (nth 5 val))
(setq pt2 (polar pt (dtr ang) dist))
(setq pt3 (polar pt2 (+ (dtr ang) pi) 3))
(command "pline" pt "w" 0.0 0.0 pt3 "w" ahead 0.0 pt2 "")
)

(command "zoom" "e")

(setvar 'osmode oldsnap)
(princ)

)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="SeaHaven_0-1727782332457.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1416395i44556431995BF000/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_0-1727782332457.png" alt="SeaHaven_0-1727782332457.png" /&gt;&lt;/span&gt;&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="SeaHaven_1-1727782651960.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1416396i5C18AB4E5807D84B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_1-1727782651960.png" alt="SeaHaven_1-1727782651960.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 11:37:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13056916#M8550</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-10-01T11:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script to -INSERT a block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13057078#M8551</link>
      <description>&lt;P&gt;Now enter command&amp;nbsp;&lt;/P&gt;&lt;P&gt;zoom&lt;/P&gt;&lt;P&gt;e&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 12:42:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-insert-a-block/m-p/13057078#M8551</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-10-01T12:42:48Z</dc:date>
    </item>
  </channel>
</rss>

