<?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 Problem with explode of Blockreference in Autocad 2010 in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499367#M70247</link>
    <description>Hi, everyone.&lt;BR /&gt;
I found a strange bug in Autocad 2010. &lt;BR /&gt;
The problem is:&lt;BR /&gt;
In Autocad 2010 i'm creating a Blockreference that consists of a polyline with a ConstantWidth = 2.&lt;BR /&gt;
After that, in my .NET source code, i'm trying to explode this Blockreference, as a result i'm receving a polyline, but when i'm trying to get its ConstantWidth value, i get - :[Autodesk.AutoCAD.Runtime.Exception] = {"eInvalidInput"}.&lt;BR /&gt;
The same code written in ObjectARX C++ returns 0.&lt;BR /&gt;
I tried to do this in Autocad 2008, and everything worked fine there. Is this a bug? Or is there some other ways to recieve, a constandwidth.&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Here is some code sample:&lt;BR /&gt;
{code}&lt;BR /&gt;
PromptSelectionResult result = Utility.Editor.GetSelection();&lt;BR /&gt;
            if (result.Status == PromptStatus.OK)&lt;BR /&gt;
            {&lt;BR /&gt;
                SelectionSet set = result.Value;&lt;BR /&gt;
                Transaction tr = null;&lt;BR /&gt;
                foreach (ObjectId id in set.GetObjectIds())&lt;BR /&gt;
                {&lt;BR /&gt;
                    Entity ent = Utility.OpenEntity(id, OpenMode.ForWrite, ref tr);&lt;BR /&gt;
                    if (ent.GetType() == typeof(BlockReference))&lt;BR /&gt;
                    {&lt;BR /&gt;
                        BlockReference blockref = (BlockReference)ent;&lt;BR /&gt;
                        BlockReference blCopy = (BlockReference)blockref.Clone();&lt;BR /&gt;
                        DBObjectCollection objs = new DBObjectCollection();&lt;BR /&gt;
                        blCopy.Explode(objs);&lt;BR /&gt;
                        foreach (DBObject obj in objs)&lt;BR /&gt;
                        {&lt;BR /&gt;
                            Entity explodeEnt = (Entity)obj;&lt;BR /&gt;
                            if (explodeEnt.GetType() == typeof(Polyline))&lt;BR /&gt;
                            {&lt;BR /&gt;
                                Polyline pl = (Polyline)explodeEnt;    &lt;BR /&gt;
                                try&lt;BR /&gt;
                                {&lt;BR /&gt;
                                    double dwidth = pl.ConstantWidth;&lt;BR /&gt;
                                }&lt;BR /&gt;
                                catch (System.Exception ex)&lt;BR /&gt;
                                {&lt;BR /&gt;
                                	Utility.ShowAfxBox(ex);&lt;BR /&gt;
                                	return;&lt;BR /&gt;
                                }&lt;BR /&gt;
                            }&lt;BR /&gt;
                        }&lt;BR /&gt;
                    }&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
{code}</description>
    <pubDate>Wed, 03 Jun 2009 06:55:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-06-03T06:55:37Z</dc:date>
    <item>
      <title>Problem with explode of Blockreference in Autocad 2010</title>
      <link>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499367#M70247</link>
      <description>Hi, everyone.&lt;BR /&gt;
I found a strange bug in Autocad 2010. &lt;BR /&gt;
The problem is:&lt;BR /&gt;
In Autocad 2010 i'm creating a Blockreference that consists of a polyline with a ConstantWidth = 2.&lt;BR /&gt;
After that, in my .NET source code, i'm trying to explode this Blockreference, as a result i'm receving a polyline, but when i'm trying to get its ConstantWidth value, i get - :[Autodesk.AutoCAD.Runtime.Exception] = {"eInvalidInput"}.&lt;BR /&gt;
The same code written in ObjectARX C++ returns 0.&lt;BR /&gt;
I tried to do this in Autocad 2008, and everything worked fine there. Is this a bug? Or is there some other ways to recieve, a constandwidth.&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
Here is some code sample:&lt;BR /&gt;
{code}&lt;BR /&gt;
PromptSelectionResult result = Utility.Editor.GetSelection();&lt;BR /&gt;
            if (result.Status == PromptStatus.OK)&lt;BR /&gt;
            {&lt;BR /&gt;
                SelectionSet set = result.Value;&lt;BR /&gt;
                Transaction tr = null;&lt;BR /&gt;
                foreach (ObjectId id in set.GetObjectIds())&lt;BR /&gt;
                {&lt;BR /&gt;
                    Entity ent = Utility.OpenEntity(id, OpenMode.ForWrite, ref tr);&lt;BR /&gt;
                    if (ent.GetType() == typeof(BlockReference))&lt;BR /&gt;
                    {&lt;BR /&gt;
                        BlockReference blockref = (BlockReference)ent;&lt;BR /&gt;
                        BlockReference blCopy = (BlockReference)blockref.Clone();&lt;BR /&gt;
                        DBObjectCollection objs = new DBObjectCollection();&lt;BR /&gt;
                        blCopy.Explode(objs);&lt;BR /&gt;
                        foreach (DBObject obj in objs)&lt;BR /&gt;
                        {&lt;BR /&gt;
                            Entity explodeEnt = (Entity)obj;&lt;BR /&gt;
                            if (explodeEnt.GetType() == typeof(Polyline))&lt;BR /&gt;
                            {&lt;BR /&gt;
                                Polyline pl = (Polyline)explodeEnt;    &lt;BR /&gt;
                                try&lt;BR /&gt;
                                {&lt;BR /&gt;
                                    double dwidth = pl.ConstantWidth;&lt;BR /&gt;
                                }&lt;BR /&gt;
                                catch (System.Exception ex)&lt;BR /&gt;
                                {&lt;BR /&gt;
                                	Utility.ShowAfxBox(ex);&lt;BR /&gt;
                                	return;&lt;BR /&gt;
                                }&lt;BR /&gt;
                            }&lt;BR /&gt;
                        }&lt;BR /&gt;
                    }&lt;BR /&gt;
                }&lt;BR /&gt;
            }&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 03 Jun 2009 06:55:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499367#M70247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-03T06:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with explode of Blockreference in Autocad 2010</title>
      <link>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499368#M70248</link>
      <description>Come on people, nobody knows how to resolve this problem?</description>
      <pubDate>Thu, 04 Jun 2009 08:08:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499368#M70248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-04T08:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with explode of Blockreference in Autocad 2010</title>
      <link>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499369#M70249</link>
      <description>Your code isn't easily readable in a newsreader.&lt;BR /&gt;
&lt;BR /&gt;
Try posting it in an attachment.  A sample DWG that shows the problem would &lt;BR /&gt;
also help.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;MAXIM_VOLOSHIN&gt; wrote in message news:6195158@discussion.autodesk.com...&lt;BR /&gt;
Come on people, nobody knows how to resolve this problem?&lt;/MAXIM_VOLOSHIN&gt;</description>
      <pubDate>Thu, 04 Jun 2009 18:59:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problem-with-explode-of-blockreference-in-autocad-2010/m-p/2499369#M70249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-04T18:59:24Z</dc:date>
    </item>
  </channel>
</rss>

