<?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 create a good rectangle for a block with GeometricExtents in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783106#M51306</link>
    <description>&lt;P&gt;.. sorry, not working....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Feb 2013 12:15:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-02-18T12:15:33Z</dc:date>
    <item>
      <title>How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3767678#M51302</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;i have created a block with n attribute.&lt;/P&gt;&lt;P&gt;i insert the block with attribute filled with fields.&lt;/P&gt;&lt;P&gt;I send the commande "Regen" for update field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i want to add a rectangle in the block définition.&lt;/P&gt;&lt;P&gt;I use GeometricExtents.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it works fine only when then the rotation is 0 and UCS on UCSW.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how i can create the line with the 4 points ? I want the line include all entity in my block def.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I joined a zip with :&lt;/P&gt;&lt;P&gt;2.dwg is the XRef in 3.dwg&lt;/P&gt;&lt;P&gt;My bloc show info from xref (2.dwg).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the dwg. the bloc contain a line. The libe i manualy added when i create the blockreccord&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2013 17:04:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3767678#M51302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-03T17:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3776478#M51303</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You mention you want to add the rectangle in the block definition, but GeometricExtents is only returned on Entities, so if your block doesn't contain too many entities, you can open the block definition, iterate through all ObjectIds, open each entity and check its extents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach would be to retrieve the extents of the block reference, apply the inverse transformation of the block reference to that extents, so you would have it express in block definition space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Philippe.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2013 18:04:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3776478#M51303</guid>
      <dc:creator>philippe.leefsma</dc:creator>
      <dc:date>2013-02-10T18:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3781587#M51304</link>
      <description>&lt;P&gt;i have to use your second solution.&lt;/P&gt;&lt;P&gt;I use attribut with field.&lt;/P&gt;&lt;P&gt;The field is fiiled when i insert the block in my dwg.&lt;/P&gt;&lt;P&gt;So i need to insert my bloc and use GeometricExtend for retrieve the extend point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it work when i have a the World UCS or User UCS (but only with then UCS in a plane of the editor.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Dont know how to calculate the correct POint for create my line when i retrieve point in UCS with a different angle other than 0 or 180 ( angle from UCS and the view in editor.)&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;here a saple of my code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; 'Création du Rectangle
        Dim ext As Extents3d
        ext = RefBloc.GeometricExtents
        ext.TransformBy(Ed.CurrentUserCoordinateSystem.Inverse())
        ''test  affichage du carré :
        Dim Newrec As New Autodesk.AutoCAD.DatabaseServices.Polyline
        Newrec.AddVertexAt(0, New Point2d(-5, 5), 0, 0, 0)
        Newrec.AddVertexAt(1, New Point2d((System.Math.Abs(ext.MaxPoint.X - ext.MinPoint.X) / RefBloc.ScaleFactors.X) + 5, 5), 0, 0, 0)
        Newrec.AddVertexAt(2, New Point2d((System.Math.Abs(ext.MaxPoint.X - ext.MinPoint.X) / RefBloc.ScaleFactors.X) + 5, (-(System.Math.Abs(ext.MaxPoint.Y - ext.MinPoint.Y)) / RefBloc.ScaleFactors.Y) - 5), 0, 0, 0)
        Newrec.AddVertexAt(3, New Point2d(-5, (-System.Math.Abs(ext.MaxPoint.Y - ext.MinPoint.Y) / RefBloc.ScaleFactors.Y) - 5), 0, 0, 0)
        Newrec.Closed = True
        Newrec.Layer = "0"
        tr = db.TransactionManager.StartTransaction
        Dim btr As BlockTableRecord = tr.GetObject(DefBloc.ObjectId, OpenMode.ForWrite)
        btr.AppendEntity(Newrec)
        tr.AddNewlyCreatedDBObject(Newrec, True)
        tr.Commit()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ths prob : GeometricExtents return 2 points in UCW&amp;nbsp; i need to translate for create a line&amp;nbsp; in my BlockDefinition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 12:19:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3781587#M51304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-15T12:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3781655#M51305</link>
      <description>&lt;P&gt;Try to replace:&lt;/P&gt;
&lt;PRE&gt;ext.TransformBy(Ed.CurrentUserCoordinateSystem.Inverse())&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;with:&lt;/P&gt;
&lt;PRE&gt;ext.TransformBy(RefBloc.BlockTransform.Inverse())&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 13:40:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3781655#M51305</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-02-15T13:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783106#M51306</link>
      <description>&lt;P&gt;.. sorry, not working....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2013 12:15:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783106#M51306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-18T12:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783110#M51307</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;.. sorry, not working....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="hps"&gt;Then I do not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;understand&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;what&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;you're trying&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to get.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;And&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;what is the connection&lt;/SPAN&gt; between&amp;nbsp;&lt;SPAN class="hps"&gt;GeometricExtents and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;UCS?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2013 12:19:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783110#M51307</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-02-18T12:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a good rectangle for a block with GeometricExtents</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783868#M51308</link>
      <description>&lt;P&gt;here a dwg sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first BlockDefinition is generated on UCW&amp;nbsp; the second with UCS. --&amp;gt; The line is not egal ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i show on the dwg the UCS i use for launch my command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have renamed the first blockdefinition . (My command reset the BlockDefinition is already exist in database)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;++&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2013 11:57:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-create-a-good-rectangle-for-a-block-with-geometricextents/m-p/3783868#M51308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-19T11:57:49Z</dc:date>
    </item>
  </channel>
</rss>

