<?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: How to find the center of Blocks? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278211#M79223</link>
    <description>&lt;P&gt;The Block is dynamic, where you can change the diameter of both inner and outer circle manually, or from a list of predetermined list of choice. Also there is a tab where you can choose if you want to make the outer circle dotted or not.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 23:47:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-27T23:47:07Z</dc:date>
    <item>
      <title>How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9275975#M79218</link>
      <description>&lt;P&gt;There is a code I'm working on right now, where the code will find and display the coordinates and radius of ONLY circle and arcs.&lt;/P&gt;&lt;P&gt;I can filter them with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(SSGET "_X" '((0 . "ARC,CIRCLE")))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT, I also have blocks where two circles with different radius is placed on the same coordinate.&lt;/P&gt;&lt;P&gt;Since these are blocks, the code above does not recognize the blocks as circles, so I can't get the coordinates.&lt;/P&gt;&lt;P&gt;I've tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(SETQ P1 (getstring T "Enter here: "))&lt;BR /&gt;\(SETQ ss1 (ssget "_x" '((0 . "INSERT")(2 . P1)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CPT (CDR (ASSOC 10 (SETQ ENTS (ENTGET EN))))&lt;BR /&gt;PTR (CDR (ASSOC 40 (SETQ ENTS (ENTGET EN))))&lt;BR /&gt;UCPT (trans CPT 0 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which does allow me to get the coordinate of the center, but not the radius. Is ASSOC 40 not the right number to use?&lt;/P&gt;&lt;P&gt;If someone can help me, that would be very helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 06:07:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9275975#M79218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-27T06:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9276079#M79219</link>
      <description>&lt;P&gt;Sorry made a tremendous mistake, and wrote stuff on the tag which I didn't mean to.&lt;BR /&gt;Tried the code again it turns out that my SSGET doesn't seem to work now.&lt;/P&gt;&lt;P&gt;I think I thought that the SSGET was working by mistake.&lt;/P&gt;&lt;P&gt;If someone can think of the problem, that would be great too.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 07:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9276079#M79219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-27T07:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9276388#M79220</link>
      <description>&lt;P&gt;Are these blocks dynamic, i.e. the circles can be different sizes; or static, the circles in the blocks are always the same size?&lt;/P&gt;&lt;P&gt;Are there two circles in the same block?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 10:05:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9276388#M79220</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-01-27T10:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9276767#M79221</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(SETQ P1 (getstring T "Enter here: "))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;\&lt;/FONT&gt;(SETQ ss1 (ssget "_x" &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;'&lt;/FONT&gt;&lt;/STRONG&gt;((0 . "INSERT")(2 . P1)))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;it turns out that my SSGET doesn't seem to work ...&lt;SPAN style="font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[You don't want that &lt;FONT color="#FF0000"&gt;backslash&lt;/FONT&gt;.]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When something in the (ssget) filter list requires evaluation -- that P1 variable -- you cannot use the "quoted list" approach with the preceding &lt;FONT color="#FF00FF"&gt;apostrophe&lt;/FONT&gt;&amp;nbsp;on the entire list, but must use the explicit &lt;FONT color="#0000FF"&gt;(list)&lt;/FONT&gt; function.&amp;nbsp; Inside that you can include a quoted list for the entity type, but you need to assemble the Block name entry with &lt;FONT color="#0000FF"&gt;(cons)&lt;/FONT&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; (SETQ&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ss1 (ssget "_x" &lt;FONT color="#0000FF"&gt;(list&lt;/FONT&gt; '(0 . "INSERT") &lt;FONT color="#0000FF"&gt;(cons&lt;/FONT&gt; 2 P1&lt;FONT color="#0000FF"&gt;))&lt;/FONT&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can get the insertion point of such a Block [may we assume that's also the center of the Circles?] from the (assoc 10) entry in entity data, but you can't get the radius of the nested Circle(s) as you do with a top-level Circle.&amp;nbsp; If the Circles in question are the outermost elements of the Block, you could find the middle of its bounding box.&amp;nbsp; Or, if you can always select the Block on one of the Circles, you could get the Circle's information with (nentsel) instead of (entsel), but that would be complicated if there might be other-than-1 scale factor(s), and/or if the Block insertion point is not also the Circle center, other-than-zero rotation.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 13:51:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9276767#M79221</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-01-27T13:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9277504#M79222</link>
      <description>&lt;P&gt;It's easier to solve these problems by posting an example drawing of what you're working with.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 17:55:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9277504#M79222</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2020-01-27T17:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278211#M79223</link>
      <description>&lt;P&gt;The Block is dynamic, where you can change the diameter of both inner and outer circle manually, or from a list of predetermined list of choice. Also there is a tab where you can choose if you want to make the outer circle dotted or not.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 23:47:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278211#M79223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-27T23:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278346#M79224</link>
      <description>&lt;P&gt;OK, what is the name of the block definition, or the effective name of one of the dynamic block references?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 01:41:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278346#M79224</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-01-28T01:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278623#M79225</link>
      <description>&lt;P&gt;Getting the center with ASSOC 10 is possible if I select these blocks manually. But I need to to filter these blocks from a bunch of other shapes and blocks, so a working filter is needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name of the block could be another problem, I'm working in Japan right now and the name given to this block is:&lt;BR /&gt;"座グリ （平面）　R3"&lt;/P&gt;&lt;P&gt;Which roughly translates to "Drill (Vertical Plane) R3"&lt;/P&gt;&lt;P&gt;Referencing a Drill hole looking from above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The name written could be an issue, but since other people also use this block, I still would like to keep the name in Japanese. Could it be that the space are full-letters, instead of half-characters normally used?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 06:26:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9278623#M79225</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-28T06:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9284659#M79226</link>
      <description>&lt;P&gt;Could the routine&amp;nbsp; use the text/attribute to provide the information.&amp;nbsp; M6 requires a standard drill and tap size.&amp;nbsp; 3 is a through hole.&amp;nbsp; And use the text insert point if it matches the circle/arc center.&amp;nbsp; Then you don't have to go in circles (pun intended).&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:19:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9284659#M79226</guid>
      <dc:creator>Scottu2</dc:creator>
      <dc:date>2020-01-30T07:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9285103#M79227</link>
      <description>&lt;P&gt;Sorry been a bit busy. You don't need to filter the blocks with the ssget, you can filter later by ignoring any non dynamic block where the effective name of the block doesn't match "*R3".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the insertion point of the block is also the centre of the circles you only need to iterate the blocks entities and find the radius of any circle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the insertion point is not the centre of the circles you will have to use the VL explode method (don't worry this preserves the original block) which returns a copy of the block entities, and iterate this list extracting the centre and radius of any circle. Then delete exploded list. It sounds complicated but is achievable without a lot of code.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 11:24:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9285103#M79227</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2020-01-30T11:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9289812#M79228</link>
      <description>&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;For dynamic block just go to &lt;A href="http://www.lee-mac.com" target="_blank"&gt;www.lee-mac.com&lt;/A&gt; and download his Dynamic block.lsp program it has everything you want in it, will return rad1 rad2 etc simply. It has get and put functions.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2020 01:33:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9289812#M79228</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2020-02-01T01:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the center of Blocks?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9317497#M79229</link>
      <description>&lt;P&gt;Sorry for the late response, been busy with other stuff.&lt;/P&gt;&lt;P&gt;Tried the Dynamic block.lsp you told me about, but couldn't find the right program I should be using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I did find another way where we just have a list of possible block names which I want the coordinates to be included.&lt;/P&gt;&lt;P&gt;and use:&lt;/P&gt;&lt;P&gt;SETQ SS1 (SSGET "_P" '((0 . "CIRCLE,INSERT")))&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which allows me to collect data on both blocks and circles.&lt;/P&gt;&lt;P&gt;(CDR (ASSOC 40 (SETQ ENTS (ENTGET EN))))&lt;/P&gt;&lt;P&gt;To get the name of the block.&lt;/P&gt;&lt;P&gt;Then I use the previously created list of acceptable blocks to check if any of the blocks should have coordinates in them.&lt;/P&gt;&lt;P&gt;I'm sure there was a better and easier way, but looking at my code which kept on not working (with my low skill sets probably) I did find a way.&lt;/P&gt;&lt;P&gt;Thank you for all your helps.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 00:35:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-find-the-center-of-blocks/m-p/9317497#M79229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-14T00:35:53Z</dc:date>
    </item>
  </channel>
</rss>

