<?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: U Shaped function in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11476446#M39986</link>
    <description>&lt;P&gt;yes please&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 01:49:08 GMT</pubDate>
    <dc:creator>rpajounia</dc:creator>
    <dc:date>2022-10-12T01:49:08Z</dc:date>
    <item>
      <title>U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472195#M39973</link>
      <description>&lt;P&gt;Is there anyway to make this shape with a function&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 06:52:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472195#M39973</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-10T06:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472219#M39974</link>
      <description>&lt;P&gt;Yes&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its a simple object using a pline and extrude. If you just look at how you would use lisp draw some lines and a top arc, then make a pline of these objects, then extrude a good learn lisp task. So please no code people need to learn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Enter length, enter height, that's all that is needed.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 07:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472219#M39974</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-10-10T07:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472243#M39975</link>
      <description>&lt;P&gt;Im making an automated lisp that makes shapes for my nesting program so i cant really make all these shapes 1 by 1 which is why im asking for a lisp and not trying to manually make each object. On average i have 60 shapes every 3 days and dont have the time to make them 1 by 1.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 07:19:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472243#M39975</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-10T07:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472803#M39976</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;Enter length, enter height, that's all that is needed.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;.... and extrusion thickness. [If that's what you meant by "height," then some other term like "width" of the pre-extruded shape is also needed.]&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 12:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472803#M39976</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-10T12:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472824#M39977</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12323643"&gt;@rpajounia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... i cant really make all these shapes 1 by 1 which is why im asking for a lisp and not trying to manually make each object. ... i &lt;SPAN&gt;dont have the time to make them 1 by 1&lt;/SPAN&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If they're not all the &lt;EM&gt;same&lt;/EM&gt; shape so they could just be Copied, a routine is going to need inputs for each one, anyway, so there must be some sort of "1 by 1" aspect to the process.&amp;nbsp; What is the source of the particulars for each shape?&amp;nbsp; Would you give the dimensions for each shape, and have the routine just do the forming and extrusion of it?&amp;nbsp; Are they in something like a spreadsheet file that a routine could read them from?&amp;nbsp; What would be the criteria for the &lt;EM&gt;location&lt;/EM&gt; of each one?&amp;nbsp; Are all the shapes of the same kind of "&lt;FONT face="verdana,geneva" color="#000000"&gt;D&lt;/FONT&gt;" shape as in your image, but with differences in sizes/proportions, or are there different varieties of shapes?&amp;nbsp; If all "&lt;FONT face="verdana,geneva" color="#000000"&gt;D&lt;/FONT&gt;" shaped, could it be done with a Block and different scale factors?&amp;nbsp; Etc., etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT:&amp;nbsp; &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autofillet/m-p/8238652/highlight/true#M373528" target="_blank" rel="noopener"&gt;&amp;gt;Here&amp;lt;&lt;/A&gt; is something that could give you some idea how to approach the&amp;nbsp;"&lt;FONT face="verdana,geneva" color="#000000"&gt;D&lt;/FONT&gt;" shape, requiring not-too-complicated adjustment to achieve that rather than the shape it makes:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1665407794313.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1125497i7E1349208370FE14/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1665407794313.png" alt="Kent1Cooper_0-1665407794313.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 13:17:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11472824#M39977</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-10T13:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473129#M39978</link>
      <description>&lt;P&gt;Thank you kent sorry guys for not being more exact, the variables that will be given to the function will be with and height ( thickness does not matter ) and what the function will do is make the D shape&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:38:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473129#M39978</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-10T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473153#M39979</link>
      <description>&lt;P&gt;You would also need to decide the orientation of the "&lt;FONT face="trebuchet ms,geneva"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;D&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;" shape -- as a "&lt;FONT face="trebuchet ms,geneva"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;D&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;", or [assuming it is done by drawing a Polyline] with the half-circle arc segment on some side other than the right, such as the bottom [given the Topic wording]?&amp;nbsp; Having determined that, and given dimensions and a starting point, a PLINE command with some (polar) functions, and switching between line and arc segments, and with calculations about the line segment lengths tangent to the arc segment, would not be difficult to construct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other things in my previous reply that you will need to address before you can complete a full routine.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:58:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473153#M39979</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-10T15:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473165#M39980</link>
      <description>&lt;P&gt;Orientation doesnt really matter i want to give 2 variables, 1 is the bottom line length, 2 is the height of the arc&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 16:00:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473165#M39980</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-10T16:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473176#M39981</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12323643"&gt;@rpajounia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Orientation doesnt really matter i want to give 2 variables, 1 is the bottom line length, 2 is the height of the arc&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Given your "bottom line" wording, I'll assume the arc segment on the top [&lt;EM&gt;upside-down&lt;/EM&gt; U, closed].&amp;nbsp; And I will assume that variable 2 is the height of the arc segment itself&amp;nbsp;&lt;EM&gt;plus&lt;/EM&gt; the length of the vertical line segments tangent to it, that connect it to the bottom line [since for this shape, the height of the arc segment itself must be half the bottom line length, so it would not need to be specified].&amp;nbsp; There should probably be a check that the specified height is &lt;EM&gt;at least&lt;/EM&gt; half the specified bottom line length.&amp;nbsp; If it is &lt;EM&gt;exactly&lt;/EM&gt; half the bottom line length, there would be no vertical line segments, and the whole Polyline would be just one line segment and one arc segment.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 16:11:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473176#M39981</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-10T16:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473831#M39982</link>
      <description>&lt;P&gt;Yes Kent forgot wanted extruded object, so length, height and thickness would be correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rpajounia ok a hint can draw a single closed pline with an arc, this is part of the pline command so look carefully at the prompts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Turn Ortho on and draw a pline drag with mouse with say across bottom, enter distance then up and a&amp;nbsp; distance then an arc then a close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do it manually with ortho on and can enter lengths, then the arc segment write down each step this is your lisp code sequence.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 23:38:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11473831#M39982</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-10-10T23:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11474976#M39983</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12323643"&gt;@rpajounia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... i want to give 2 variables, 1 is the bottom line length, 2 is the height of the arc&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Given your "bottom line" wording, I'll assume the arc segment on the top [&lt;EM&gt;upside-down&lt;/EM&gt; U, closed].&amp;nbsp; And I will assume that variable 2 is the height of the arc segment itself&amp;nbsp;&lt;EM&gt;plus&lt;/EM&gt; the length of the vertical line segments tangent to it....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1665492472793.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1125882i177E3500E07CD3B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1665492472793.png" alt="Kent1Cooper_0-1665492472793.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That would not be a difficult thing to program a PLINE command to draw, and an extrusion thickness could also be included easily enough if you change your mind from "&lt;SPAN&gt;( thickness does not matter )" in Message 6&amp;nbsp;&lt;/SPAN&gt;back to something like your original image.&amp;nbsp; But the questions remain about where those values are coming from for all the multiple shapes, how they should be positioned relative to each other, etc.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 12:54:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11474976#M39983</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-11T12:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11475388#M39984</link>
      <description>&lt;P&gt;Yes your correct my lisp file is reading a text file that is giving the variables and positioning them at (0,0) once all the shapes are drawn it takes the entities and nests them for cutting&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 15:43:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11475388#M39984</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-11T15:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11475510#M39985</link>
      <description>&lt;P&gt;It sounds from more than one of your Messages like you have a routine going already with some of what you want to do.&amp;nbsp; Adding to it, have it read a line from the text file [what is the format of the information?], start a PLINE command presumably at 0,0, go right by the base dimension, up by the height minus half the base dimension, get into Arc mode and go left by the base dimension, get back into Line mode and Close.&amp;nbsp; Do you know how to add code to do that kind of thing?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 16:31:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11475510#M39985</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-11T16:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11476446#M39986</link>
      <description>&lt;P&gt;yes please&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 01:49:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11476446#M39986</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-12T01:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11476466#M39987</link>
      <description>&lt;P&gt;Post the text file as a sample and correct dwg that matches. We don't want to keep changing code as information becomes available.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 02:00:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11476466#M39987</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-10-12T02:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11478347#M39988</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12323643"&gt;@rpajounia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Im making an automated lisp ....&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;....my lisp file is reading a text file...&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;yes please&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Those first two are what suggest to me that you have something started.&amp;nbsp; There's no point in our starting from scratch if it will duplicate what you have already.&amp;nbsp; Post that in addition to the sample text file that&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;requested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What was the third line above in reply to?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 18:07:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11478347#M39988</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-12T18:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11479568#M39989</link>
      <description>&lt;P&gt;Yes please was targeted as you got what i would like as correct. I would like x = 10 y = 10 z = 5 and it output this diagram y = height of diagram with arc&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 09:12:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11479568#M39989</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-13T09:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11480102#M39990</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12323643"&gt;@rpajounia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... I would like x = 10 y = 10 z = 5 ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That does not help unless you intend to type in values individually for all the shapes, which Message 3 says you do not.&amp;nbsp; You have mentioned, but [after several requests] not yet posted an example of, a text file from which the values would be read, nor have we seen whatever code you have already.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 13:22:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11480102#M39990</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-13T13:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11480754#M39991</link>
      <description>&lt;P&gt;Code is below im making a function now for UShape and and i will put a if statement to check for that next&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;(defun c:DrawLayout2 (/ Thickness WidthText Width a b c ab bc DidLines 1InchList 2InchList 3InchList 4InchList 5InchList 6InchList)
      (setq p1 '(-1500. -1000. 0.))
      (setq p2 '(8000.0 5000.0 0.0))
      (command "._zoom" "_w" "_non" p1 "_non" p2) ; end zoom
      (princ)
      (setq DidLines 0)
      (setq 1InchList (ssadd))
      (setq 2InchList (ssadd))
      (setq 3InchList (ssadd))
      (setq 4InchList (ssadd))
      (setq 5InchList (ssadd))
      (setq 6InchList (ssadd))
      (setq 1InchList84x96 (ssadd))
      (setq 2InchList84x96 (ssadd))
      (setq 3InchList84x96 (ssadd))
      (setq 4InchList84x96 (ssadd))
      (setq 5InchList84x96 (ssadd))
      (setq 6InchList84x96 (ssadd))
      ;(setq des2 (open (strcat "C:\\Users\\Raymons\\Desktop\\Customs ISO\\CustomCut.xml") "r"))
      (setq des2 (open (strcat "C:\\Users\\RPajo\\OneDrive\\Desktop\\Customs\\CustomCut.xml") "r"))
      (while (and (setq line (read-line des2)))
            (setq Thickness (substr line 1 (vl-string-position (ascii "x") line )))
            (setq WidthText (vl-string-subst "" (strcat Thickness "x") line))
            (setq Width (substr WidthText 1 (vl-string-position (ascii "x") WidthText )))
            (if (vl-string-search "Circle" line)
              (progn

                  (setq Width (substr WidthText 1 (vl-string-position (ascii "Circle") WidthText )))
                  (setq QuantityText (vl-string-subst "" (strcat Thickness "x" Width "Circle ( 1.8 Density / 44 ILD ) ") line))
                  (setq Quantity (substr QuantityText 1 (vl-string-position (ascii " ") QuantityText )))
                  (repeat (read Quantity)
                    (if (&amp;lt;= (read Width) 72)
                        (progn
                              (if (= (read Thickness) 1)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 1InchList)
                                )
                              )
                              (if (= (read Thickness) 2)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 2InchList)
                                )
                              )
                              (if (= (read Thickness) 3)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 3InchList)
                                )
                              )
                              (if (= (read Thickness) 4)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 4InchList)
                                )
                              )
                              (if (= (read Thickness) 5)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 5InchList)
                                )
                              )
                              (if (= (read Thickness) 6)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 6InchList)
                                )
                              )
                         )
                        (progn
                              (if (= (read Thickness) 1)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 1InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 2)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 2InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 3)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 3InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 4)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 4InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 5)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 5InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 6)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 6InchList84x96)
                                )
                              )
                         )
                      )
                  )
              )
              (progn
                  (if (vl-string-search "Trap" line)
                    (progn
                          (setq LengthText (vl-string-subst "" (strcat Thickness "x" Width "x") line))
                        (setq Length1 (substr LengthText 1 (vl-string-position (ascii "x") LengthText )))
                        (setq OverCutText (vl-string-subst "" (strcat Thickness "x" Width "x" Length1 "x") line))
                        (setq OverCut (substr OverCutText 1 (vl-string-position (ascii "x") OverCutText )))
                        (setq BumpText (vl-string-subst "" (strcat Thickness "x" Width "x" Length1 "x" OverCut "x") line))
                        (setq Bump (vl-string-subst "" "Trap" (substr BumpText 1 (vl-string-position (ascii " ") BumpText ))))
                        (setq QuantityText (vl-string-subst "" (strcat Thickness "x" Width "x" Length1 "x" OverCut "x" Bump "Trap ( 1.8 Density / 44 ILD ) ") line))
                        (setq Quantity (substr QuantityText 1 (vl-string-position (ascii " ") QuantityText )))
                        (setq  p1 (list 0 0 0)
                               p2 (list (* (read Length1) 25.4) (* (read Width) 25.4) ))
                        
                        (repeat (read Quantity)
                              (if (&amp;lt;= (read Width) 72)
                                (progn
                                    (if (= (read Thickness) 1)
                                      (progn
                                        (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4) ) 1InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 2)
                                      (progn
                                         (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 2InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 3)
                                      (progn
                                         (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 3InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 4)
                                      (progn
                                        (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 4InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 5)
                                      (progn
                                         (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 5InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 6)
                                      (progn
                                        (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 6InchList)
                                      )
                                    )
                                 )
                                (progn
                                    (if (= (read Thickness) 1)
                                      (progn
                                        (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 1InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 2)
                                      (progn
                                         (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 2InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 3)
                                      (progn
                                         (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 3InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 4)
                                      (progn
                                        (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 4InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 5)
                                      (progn
                                         (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 5InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 6)
                                      (progn
                                        (ssadd (_trap p1 p2 (* (- (read Length1) (read OverCut)) 12.7) (* (read Bump) 25.4)) 6InchList84x96)
                                      )
                                    )
                                )
                              )
                          )
                    )
                    (progn
                        (setq LengthText (vl-string-subst "" (strcat Thickness "x" Width "x") line))
                        (setq Length1 (substr LengthText 1 (vl-string-position (ascii " ") LengthText )))
                        (setq QuantityText (vl-string-subst "" (strcat Thickness "x" Width "x" Length1 " ( 1.8 Density / 44 ILD ) ") line))
                        (setq Quantity (substr QuantityText 1 (vl-string-position (ascii " ") QuantityText )))
                        (setq  p1 (list 0 0 0)
                              p2 (list (* (read Length1) 25.4) (* (read Width) 25.4) ))
                        (repeat (read Quantity)
                              (if (&amp;lt;= (read Width) 72)
                                (progn
                                    (if (= (read Thickness) 1)
                                      (progn
                                        (ssadd (_rect p1 p2) 1InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 2)
                                      (progn
                                         (ssadd (_rect p1 p2) 2InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 3)
                                      (progn
                                         (ssadd (_rect p1 p2) 3InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 4)
                                      (progn
                                        (ssadd (_rect p1 p2) 4InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 5)
                                      (progn
                                         (ssadd (_rect p1 p2) 5InchList)
                                      )
                                    )
                                    (if (= (read Thickness) 6)
                                      (progn
                                        (ssadd (_rect p1 p2) 6InchList)
                                      )
                                    )
                                 )
                                (progn
                                    (if (= (read Thickness) 1)
                                      (progn
                                        (ssadd (_rect p1 p2) 1InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 2)
                                      (progn
                                         (ssadd (_rect p1 p2) 2InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 3)
                                      (progn
                                         (ssadd (_rect p1 p2) 3InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 4)
                                      (progn
                                        (ssadd (_rect p1 p2) 4InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 5)
                                      (progn
                                         (ssadd (_rect p1 p2) 5InchList84x96)
                                      )
                                    )
                                    (if (= (read Thickness) 6)
                                      (progn
                                        (ssadd (_rect p1 p2) 6InchList84x96)
                                      )
                                    )
                                )
                              )
                          )
                      )
                  )
              )
            )
        (setq DidLines (1+ DidLines))
      )
)

(defun _rect (p1 p2 / lt point2d x1 y1 x2 y2 pts q)
      (defun lt (pt) (trans pt 1 0))
      (defun point2d (pt) (list (car pt) (cadr pt)))
        ;(command "_.ucs" "w")
      (setq
            x1 (apply 'min (mapcar 'car (list p1 p2)))
            y1 (apply 'min (mapcar 'cadr (list p1 p2)))
            x2 (apply 'max (mapcar 'car (list p1 p2)))
            y2 (apply 'max (mapcar 'cadr (list p1 p2)))
          pts (mapcar 'point2d(mapcar 'lt (list (list x1 y1) (list x2 y1) (list x2 y2) (list x1 y2))))
      )
      (cond
            ((and pts)
                  (setq q (entmakex
                        (apply 'append
                              (cons
                                (list
                                    '(0 . "LWPOLYLINE")
                                    '(100 . "AcDbEntity")
                                    '(100 . "AcDbPolyline")
                                    '(410 . "Model")
                                    '(8 . "0")
                                    '(38 . 0)
                                    '(62 . 256)
                                    '(67 . 0)
                                    (cons 90 (length pts))
                                    '(70 . 1)
                                )
                                (mapcar 'list (mapcar '(lambda (a) (cons 10 a)) pts))
                              )
                        )
                  ))
            )
      )
      q
)

(defun _circl (p1 / lt point2d x1 y1 x2 y2 pts q)
      (setq q (entmakex (append (list (cons 0 "CIRCLE") (cons 10 (list 0 0 0)) (cons 40 p1)))))
      q
)

(defun _trap (p1 p2 p3 p4 / lt point2d x1 y1 x2 y2 pts q)
      (defun lt (pt) (trans pt 1 0))
      (defun point2d (pt) (list (car pt) (cadr pt)))
        ;(command "_.ucs" "w")
      (princ "doing setq")
      (setq
            x1 (apply 'min (mapcar 'car (list p1 p2)))
            y1 (apply 'min (mapcar 'cadr (list p1 p2)))
            x2 (apply 'max (mapcar 'car (list p1 p2)))
            y2 (apply 'max (mapcar 'cadr (list p1 p2)))
          pts (mapcar 'point2d(mapcar 'lt (list (list x1 y1) (list x2 y1) (list x2 (+ y1 p4) ) (list (- x2 p3) y2) (list (+ x1 p3) y2) (list x1 (+ y1 p4) ) )))
      )
 
      (cond
            ((and pts)
                  (setq q (entmakex
                        (apply 'append
                              (cons
                                (list
                                    '(0 . "LWPOLYLINE")
                                    '(100 . "AcDbEntity")
                                    '(100 . "AcDbPolyline")
                                    '(410 . "Model")
                                    '(8 . "0")
                                    '(38 . 0)
                                    '(62 . 256)
                                    '(67 . 0)
                                    (cons 90 (length pts))
                                    '(70 . 1)
                                )
                                (mapcar 'list (mapcar '(lambda (a) (cons 10 a)) pts))
                              )
                        )
                  ))
            )
      )
      q
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Oct 2022 17:31:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11480754#M39991</guid>
      <dc:creator>rpajounia</dc:creator>
      <dc:date>2022-10-13T17:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: U Shaped function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11483231#M39992</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12323643"&gt;@rpajounia&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;LI-CODE lang="general"&gt;....
                    (if (&amp;lt;= (read Width) 72)
                        (progn
                              (if (= (read Thickness) 1)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 1InchList)
                                )
                              )
                              (if (= (read Thickness) 2)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 2InchList)
                                )
                              )
                              (if (= (read Thickness) 3)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 3InchList)
                                )
                              )
                              (if (= (read Thickness) 4)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 4InchList)
                                )
                              )
                              (if (= (read Thickness) 5)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 5InchList)
                                )
                              )
                              (if (= (read Thickness) 6)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 6InchList)
                                )
                              )
                         )
                        (progn
                              (if (= (read Thickness) 1)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 1InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 2)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 2InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 3)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 3InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 4)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 4InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 5)
                                (progn
                                   (ssadd (_circl (* (read Width) 12.7)) 5InchList84x96)
                                )
                              )
                              (if (= (read Thickness) 6)
                                (progn
                                  (ssadd (_circl (* (read Width) 12.7)) 6InchList84x96)
                                )
                              )
                         )
                      )
....&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We still haven't seen the nature of the content of the text file you're pulling information from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in any case, your code can be &lt;EM&gt;greatly&lt;/EM&gt; reduced in a variety of ways.&lt;/P&gt;
&lt;P&gt;You have unnecessary&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (progn)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;"wrappers" around things that don't need them [&lt;EM&gt;single&lt;/EM&gt; functions -- mostly&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (ssadd)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;-- used as 'then' arguments in&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (if)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;functions, where&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (progn)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;is needed only when &lt;EM&gt;multiple&lt;/EM&gt; functions &lt;EM&gt;together&lt;/EM&gt; are needed as the single 'then' or 'else' argument].&lt;/P&gt;
&lt;P&gt;You have conversions of strings to non-text that you don't need, such as:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (if (= (read Thickness) 1)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;when you could just do:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; (if (= Thickness "1")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You have multiple (if) functions that would be better handled with&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;(cond)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;functions [but the following would eliminate a lot of that anyway].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any time the &lt;EM&gt;same code&lt;/EM&gt; is repeated multiple times, there's probably a way to reconfigure things to contain it fewer times, or even just &lt;EM&gt;once&lt;/EM&gt;.&amp;nbsp; One of the more extreme examples is that [I believe -- untested] the &lt;EM&gt;entire excerpt quoted above&lt;/EM&gt; can be replaced with just this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(ssadd
  (_circl (* (read Width) 12.7))
  (read (strcat Thickness "InchList" (if (&amp;gt; (read Width) 72) "84x96" "")))
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and similarly for the "Trap" portion and the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (_rect)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;portion if it's not "Circle" or "Trap."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Speaking of which, if you use a RECTANG &lt;EM&gt;command&lt;/EM&gt;, it's not necessary to convert points between the current UCS and the WCS, nor to convert them to XY only coordinates, nor to calculate the other two corners.&amp;nbsp; Your&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (_circ1)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;function doesn't specify model space or Layer 0 as the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (_rect)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;and&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt; (_trap)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;functions do, so if I can assume you are there when you run this, or it doesn't really matter if the objects are just drawn on the current Layer, you should be able to replace the&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;(_rect)&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/FONT&gt;function with just this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun _rect (p1 p2)
  (command "_.rectang" "_non" p1 "_non" p2)
  (setq q (entlast))
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, it "takes longer," but you would need to be making a very large number of them for that to make a meaningful difference.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:33:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/u-shaped-function/m-p/11483231#M39992</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2022-10-14T15:33:41Z</dc:date>
    </item>
  </channel>
</rss>

