<?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 Can't select entity after overrule in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5851347#M38394</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am creating a plugin for a project that will allow users to display&amp;nbsp;polylines etc as 3d solids using the overrule by apply xdata with the radius.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Works fine on the most part, but on the occasion that a swept solid can't create, I want the overrule to be disabled (I have already got the xdata being removed working).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;public override bool WorldDraw(Drawable d, WorldDraw wd)
            {
            double radius = 0.0;

            if (d is DBObject)
                radius = GetPipeRadius((DBObject)d);

            if (radius &amp;gt; 0.0)
                {
                Polyline pline = d as Polyline;

                if (pline != null)
                    {
                    Solid3D sol = GeometryServices.CreatePipe((Entity)pline, radius);

                    if (!sol.Created) // this is a property in my inherited solid3d class
                        return false;
                    
                    base.WorldDraw(pline, wd);
                    
                    short c = wd.SubEntityTraits.Color;
                    wd.SubEntityTraits.Color = GeometryServices.GetColour(pline.Layer);
                    wd.SubEntityTraits.LineWeight = LineWeight.ByLineWeightDefault;

                    sol.WorldDraw(wd);
                    sol.Dispose();
                    wd.SubEntityTraits.Color = c;
                    return true;

                    }
                }
            return base.WorldDraw(d, wd);
            }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently the code executes, but after (if the solid doesn't create), I am not able to select the polyline. No grips are shown, wont show in properties, can't list it. After I do an audit, it is back to normal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone see how I can do this? happy to provide more code if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brent&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2015 01:34:46 GMT</pubDate>
    <dc:creator>BrentBurgess1980</dc:creator>
    <dc:date>2015-10-08T01:34:46Z</dc:date>
    <item>
      <title>Can't select entity after overrule</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5851347#M38394</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am creating a plugin for a project that will allow users to display&amp;nbsp;polylines etc as 3d solids using the overrule by apply xdata with the radius.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Works fine on the most part, but on the occasion that a swept solid can't create, I want the overrule to be disabled (I have already got the xdata being removed working).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;public override bool WorldDraw(Drawable d, WorldDraw wd)
            {
            double radius = 0.0;

            if (d is DBObject)
                radius = GetPipeRadius((DBObject)d);

            if (radius &amp;gt; 0.0)
                {
                Polyline pline = d as Polyline;

                if (pline != null)
                    {
                    Solid3D sol = GeometryServices.CreatePipe((Entity)pline, radius);

                    if (!sol.Created) // this is a property in my inherited solid3d class
                        return false;
                    
                    base.WorldDraw(pline, wd);
                    
                    short c = wd.SubEntityTraits.Color;
                    wd.SubEntityTraits.Color = GeometryServices.GetColour(pline.Layer);
                    wd.SubEntityTraits.LineWeight = LineWeight.ByLineWeightDefault;

                    sol.WorldDraw(wd);
                    sol.Dispose();
                    wd.SubEntityTraits.Color = c;
                    return true;

                    }
                }
            return base.WorldDraw(d, wd);
            }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently the code executes, but after (if the solid doesn't create), I am not able to select the polyline. No grips are shown, wont show in properties, can't list it. After I do an audit, it is back to normal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone see how I can do this? happy to provide more code if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brent&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 01:34:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5851347#M38394</guid>
      <dc:creator>BrentBurgess1980</dc:creator>
      <dc:date>2015-10-08T01:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select entity after overrule</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5852344#M38395</link>
      <description>&lt;P&gt;It looks like XData&amp;nbsp;filter to the overruled entities is not enough and you need further filtering, which you do it in the WorldDraw() override. More logic approach would be to use customFilter and override IsApplicable() and make a thorough filtering before the overrule applies. That is, you do not call&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SetXDataFilrer(sring)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead, you call&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SetCustomFilter()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then write code in IsApplicable() to find out if the polyline has particular XData attached and if it has 0 radius.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that said, from you code, it seems that you need to place&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return base.WorldDraw(d,wd)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the "else..." clause. That is, if radius &amp;gt; 0.0, then you want draw solid, otherwise, still draw polyline. You currently leave "return base.WorldDraw() outside the "if..." statement, so it is always called (thus the polyline is always drawn, in spite of a solid may have already been drawn.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 14:22:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5852344#M38395</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2015-10-08T14:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select entity after overrule</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5853505#M38396</link>
      <description>&lt;P&gt;Thanks Norman. I'll&amp;nbsp;work through that and see how I go.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 23:31:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5853505#M38396</guid>
      <dc:creator>BrentBurgess1980</dc:creator>
      <dc:date>2015-10-08T23:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can't select entity after overrule</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5853567#M38397</link>
      <description>&lt;P&gt;I found that I had the SetXdataFilter in my derived base class, but the real problem was that if the solid wasn't created, I was trying to remove the XData, and once the XData was removed it didnt function properly. I removed that line and it worked well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 00:37:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-t-select-entity-after-overrule/m-p/5853567#M38397</guid>
      <dc:creator>BrentBurgess1980</dc:creator>
      <dc:date>2015-10-09T00:37:23Z</dc:date>
    </item>
  </channel>
</rss>

