<?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: Rectangle (square) with Holes in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5964083#M135708</link>
    <description>&lt;P&gt;tgarikai,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your pump list going to be 50+ entries that you need the program to read from a (xls, cvs, txt) file? If you only have a small list of entries, I would just incorporate the list with some (cond.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your sample spreadsheet it looks like Pump Size P1 does not apply as Pump Size P2 are all different numbers. Will this stay true?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also see for Pump Size P1 (32-125) you have two 142 for Pump Size P2 which will propose a problem. Was that just a typo?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Dec 2015 01:59:50 GMT</pubDate>
    <dc:creator>smaher12</dc:creator>
    <dc:date>2015-12-24T01:59:50Z</dc:date>
    <item>
      <title>Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5960400#M135705</link>
      <description>&lt;P&gt;This topic may have been addressed before but i may have missed it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to write an Autolisp routine to do a rectangualar base plate where the user inputs the following parameters:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Length and Width of the rectangle (base plate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Number of holes (Ideally between 4 and 10) and their sizes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Centre distances between the holes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 14:20:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5960400#M135705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-21T14:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5960527#M135706</link>
      <description>&lt;P&gt;Welcome to these Forums!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That sounds like it should be doable, but so many questions arise....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What about distance(s) from plate edge(s) to hole center-lines? &amp;nbsp;Would the User specify that [or those?], or would that/they be just what's left over as a result of the number of holes and their spacing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All holes always the &lt;EM&gt;same size&lt;/EM&gt; in each plate, or might there be &lt;EM&gt;different&lt;/EM&gt; sizes within one plate?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always &lt;EM&gt;equally spaced&lt;/EM&gt; holes? &amp;nbsp;If so, the same in both directions, or equally within each direction but possibly different in the two directions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think [from my&amp;nbsp;experience with such things, limited&amp;nbsp;as it is] I can assume it will always be an even number of holes. &amp;nbsp;But would they always be in two rows down opposite edges, or might there sometimes be configurations such as this?&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/207877i92C34311FC09C66C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="BasePlate.png" title="BasePlate.png" width="139" height="141" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always only around the &lt;EM&gt;edges&lt;/EM&gt; like that, or might there sometimes be any &lt;EM&gt;internal&lt;/EM&gt; hole(s)? &amp;nbsp;[In which case, the number might be odd....]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A sample drawing or image showing the extremes of the range of possibilities would be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meanwhile, since you say "&lt;EM&gt;I&lt;/EM&gt; need to write" [always a welcome thing here], may we assume you already know enough to write some of the starting elements? &amp;nbsp;Prompts for the inputs, and saving them into variables, etc. &amp;nbsp;People here can help you with ways to create the plate outline and calculate&amp;nbsp;what's needed to place the holes from there.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 15:36:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5960527#M135706</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2015-12-21T15:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5961569#M135707</link>
      <description>&lt;P&gt;Thank kent for the response and eye opener. We have sort of refined the problem but it has become more complex&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the new base plate configuartion and possible pump configurations. NOTE there are more configurations that can be added.&lt;/P&gt;&lt;P&gt;Now the procedure should be like this:&lt;/P&gt;&lt;P&gt;1. The user selects the primary pump size (P1)after which&lt;/P&gt;&lt;P&gt;2. the user selects the secondary pump size (p2) after which&lt;/P&gt;&lt;P&gt;3. The programm draws up the base plate layout based on the correct data picked from the excel spreadsheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point i would appreciate help with the coding and the determination/calculations of variables and or linking to a spreadsheet or databse as provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot..&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 07:13:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5961569#M135707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-22T07:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5964083#M135708</link>
      <description>&lt;P&gt;tgarikai,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your pump list going to be 50+ entries that you need the program to read from a (xls, cvs, txt) file? If you only have a small list of entries, I would just incorporate the list with some (cond.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your sample spreadsheet it looks like Pump Size P1 does not apply as Pump Size P2 are all different numbers. Will this stay true?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also see for Pump Size P1 (32-125) you have two 142 for Pump Size P2 which will propose a problem. Was that just a typo?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 01:59:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5964083#M135708</guid>
      <dc:creator>smaher12</dc:creator>
      <dc:date>2015-12-24T01:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5964139#M135709</link>
      <description>&lt;P&gt;Hi Advocate Smaher12&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://forums.autodesk.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes the entries exceed 50+&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P1 is the main category for various pump sizes. In other words there are 7 pump sizes falling under size 32-125.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With regards to the two 142s, it was a bit of an oversight from me, the first 142 is a 2-pole and the second 142 is a 4-pole. In other words we can further define it as 142-2 and 142-4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 05:06:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5964139#M135709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-24T05:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5989036#M135710</link>
      <description>&lt;P&gt;With the help of Afralisp.net I was able to get the following together. Rather than reading from a excel file this program reads from .dat files. The program has good bones and the&amp;nbsp;next step would probably be to solve the hole quanity. lsp and dat files are in the attached file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:Test (/ item data dline maxs 
                    count chrct numb size)

  (setq ptype 
    (getstring "\nEnter Pump Type &amp;lt;32-125.1, 32-125&amp;gt;: "))

  (setq size 
    (getstring "\nEnter Size &amp;lt;100, 110, 121&amp;gt;: "))	;enter size req'd
  (setq dlist nil
	size  (strcat "*" size)				;add asterix to size
	ptype (strcat ptype ".dat")
	file  (findfile ptype)  			;find data file
	fp    (open file "r")				;open file to read
	item  (read-line fp)				;first line is label for file
  );setq

  (while item						;process each line of file
    (if	(= item size)					;compare values
      (setq data (read-line fp)				;read a line
	    item nil					;stop searching for item
      );setq
      (setq item (read-line fp))			;keep searching for item
    );if
  );while
  (if data						;if the size has been found
    (progn
      (setq maxs  (strlen data)				;establish length of input
	    count 1					;initiliaze count
	    chrct 1					;initiliaze char position
      );setq
      (while (&amp;lt; count maxs)				;process string one chr at a time
	(if (/= "," (substr data count 1))		;look for the commas
	  (setq chrct (1+ chrct))			;increment to next position
	  (setq	numb  (atof 
               (substr data 
		  (1+ (- count chrct)) chrct))  	;convert to real
		dlist (append dlist (list numb))	;add it to the list
		chrct 1					;resets field ct
	  );setq
	);if
	(setq count (1+ count))				;increment the counter
      );while
      (setq numb  (atof 
           (substr data 
                  (1+ (- count chrct))))        	;convert to real
	    dlist (append dlist (list numb))		;add it to the list
      );setq
    );progn
  );if data
  (close fp)						;close data file
(mapcar 'set '(a b c d e f) dlist)			;allocate to variables

  (setq p1 (getpoint "\nSpecify starting point: "))
  (command "_.pline"
    "_none" (list (- (car p1) (/ a 2)) (- (cadr p1) (/ d 2)))
    "_none" (list (+ (/ a 2) (car p1)) (- (cadr p1) (/ d 2)))
    "_none" (list (+ (/ a 2) (car p1)) (+ (/ d 2) (cadr p1)))
    "_none" (list (- (car p1) (/ a 2)) (+ (/ d 2) (cadr p1)))
    "c"
  )
  (setq p2 (list (- (car p1) (/ c 2)) (cadr p1))
        p3 (list (+ (/ c 2) (car p1)) (cadr p1))
  )
  (command 
    "_.circle" "_none" (list (car p1) (+ (/ e 2) (cadr p1))) f 
    "_.circle" "_none" (list (car p1) (- (cadr p1) (/ e 2))) f
    "_.circle" "_none" (list (car p2) (+ (/ e 2) (cadr p2))) f
    "_.circle" "_none" (list (car p2) (- (cadr p2) (/ e 2))) f
    "_.circle" "_none" (list (car p3) (+ (/ e 2) (cadr p3))) f
    "_.circle" "_none" (list (car p3) (- (cadr p3) (/ e 2))) f ""
  )
 (princ)
);defun&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Credits:&amp;nbsp;&lt;A href="http://www.afralisp.net/autolisp/tutorials/external-data.php" target="_self"&gt;http://www.afralisp.net/autolisp/tutorials/external-data.php&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 15:57:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5989036#M135710</guid>
      <dc:creator>smaher12</dc:creator>
      <dc:date>2016-01-14T15:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5990202#M135711</link>
      <description>&lt;P&gt;Thanks for this insight SMAHER12, i am looking at it now and will come back with a report shortly.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 05:29:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5990202#M135711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-15T05:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rectangle (square) with Holes</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5994321#M135712</link>
      <description>&lt;P&gt;tgarikai,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a few updates with the attached file. As far as the error that you were receiving previously, don't forget to have the .dat files in the same location as your .lsp file.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 18:41:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rectangle-square-with-holes/m-p/5994321#M135712</guid>
      <dc:creator>smaher12</dc:creator>
      <dc:date>2016-01-18T18:41:40Z</dc:date>
    </item>
  </channel>
</rss>

