<?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 : .NET training labs in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566292#M54100</link>
    <description>&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&amp;nbsp;(fullEntPath.Length&amp;nbsp;&amp;gt;&amp;nbsp;0)&amp;nbsp;&lt;SPAN&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;was the 1st thing i tried before i came to this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the if statement does run tho.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Aug 2012 08:03:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-08-06T08:03:40Z</dc:date>
    <item>
      <title>.NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566056#M54096</link>
      <description>&lt;P&gt;hey all. &amp;nbsp;i'll be frequenting regularly this forum from now on. asking all kinds of dumb questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like:&lt;/P&gt;&lt;P&gt;who made the these training labs? &amp;nbsp;&lt;A target="_blank" href="http://images.autodesk.com/adsk/files/autocad_net_training0.zip"&gt;http://images.autodesk.com/adsk/files/autocad_net_training0.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im having trouble with lab6&lt;/P&gt;&lt;P&gt;an editor.PointMonitor event triggers this sub routine called myPointMonitor&lt;/P&gt;&lt;P&gt;&amp;nbsp;-the lab then declare a&amp;nbsp;FullSubentityPath variable =&amp;nbsp;e.Context.GetPickedEntities()&lt;/P&gt;&lt;P&gt;&amp;nbsp;and checks IF&amp;nbsp;(fullEntPath.Length) Then &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should their not be an&amp;nbsp;argument&amp;nbsp;here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i get " out of bound of array " here. &amp;nbsp; and the IF statement is never executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if anyone can assist id appreciate it.&lt;/P&gt;&lt;P&gt;bare in mind i'm new to the autocad api &amp;nbsp;and have only indermediate exprience with vb.net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit: sry &amp;nbsp; the IF is executed &amp;nbsp;but encounters the exception @&lt;/P&gt;&lt;P&gt;Dim ent As Curve = trans.GetObject(fullEntPath(0).GetObjectIds(0), OpenMode.ForRead)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Aug 2012 23:41:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566056#M54096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-05T23:41:00Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566204#M54097</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to replace Curve with Entity:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Dim ent As Entity = trans.GetObject(fullEntPath(0).GetObjectIds(0), OpenMode.ForRead)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 06:02:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566204#M54097</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-08-06T06:02:43Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566248#M54098</link>
      <description>&lt;P&gt;it seems that was not the intention because further&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Dim pnt As Point3d = ent.&lt;STRONG&gt;GetPointAtDist&lt;/STRONG&gt;(myTypedVal.Value)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GetPointAtDist&amp;nbsp;&lt;/STRONG&gt;is not a member of entity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;open lab6 and run debug.. check it out , its a small download&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 07:15:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566248#M54098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T07:15:22Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566260#M54099</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&amp;nbsp;(fullEntPath.Length)&amp;nbsp;&lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;This won't work with C# or (I think) VB with Option Strict On.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&amp;nbsp;(fullEntPath.Length&amp;nbsp;&amp;gt;&amp;nbsp;0)&amp;nbsp;&lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Aug 2012 07:34:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566260#M54099</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-08-06T07:34:16Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566292#M54100</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&amp;nbsp;(fullEntPath.Length&amp;nbsp;&amp;gt;&amp;nbsp;0)&amp;nbsp;&lt;SPAN&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;was the 1st thing i tried before i came to this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the if statement does run tho.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 08:03:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566292#M54100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T08:03:40Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566990#M54101</link>
      <description>&lt;P&gt;Ok, I downloaded the lab and looked up into the code.&lt;/P&gt;&lt;P&gt;I do not know if it's your problem but an exception will occur with the "newInput" command if the cursor comes near an entity which is not a curve.&lt;/P&gt;&lt;P&gt;The "MyInputMonitor" code would check if the entity is a curve. Here's a way (not certain about the VB syntax):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;replace:&lt;/P&gt;&lt;PRE&gt;' open the Entity for read, it must be derived from Curve&lt;BR /&gt;Dim ent As Curve = trans.GetObject(fullEntPath(0).GetObjectIds(0), OpenMode.ForRead)&lt;BR /&gt;&lt;BR /&gt;' ok, so if we are over something - then check to see if it has an extension dictionary
If (ent.ExtensionDictionary.IsValid) Then&lt;BR /&gt;    '...&lt;/PRE&gt;&lt;P&gt;with&lt;/P&gt;&lt;PRE&gt;' open the Entity for read, try to cast it as Curve&lt;BR /&gt;Dim ent As Curve = TryCast(trans.GetObject(fullEntPath(0).GetObjectIds()(0), OpenMode.ForRead), Curve)
&lt;BR /&gt;' ok, so if we are over something - then check to see if it is a curve and if it has an extension dictionary&lt;BR /&gt;If ent IsNot Nothing AndAlso ent.ExtensionDictionary.IsValid Then&lt;BR /&gt;    '...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 16:53:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3566990#M54101</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-08-06T16:53:47Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567070#M54102</link>
      <description>&lt;P&gt;Oops. That would be a bug. I'll have someone update the labs with the corrected code. Sorry for the inconvenience and thanks for reporting it.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 17:50:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567070#M54102</guid>
      <dc:creator>StephenPreston</dc:creator>
      <dc:date>2012-08-06T17:50:39Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567106#M54103</link>
      <description>&lt;P&gt;Hi Stephen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's the same 'bug' in the C# code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: IMO, arriving to this step in the training (using event handlers) it can be assumed that the learner should know enough about debugging and type casting to correct this by himself...&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 18:13:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567106#M54103</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-08-06T18:13:44Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567110#M54104</link>
      <description>&lt;P&gt;ooooh.. &amp;nbsp;here is the culprit himself. &amp;nbsp;&lt;img id="cattongue" class="emoticon emoticon-cattongue" src="https://forums.autodesk.com/i/smilies/16x16_cat-tongue.png" alt="Cat Tongue" title="Cat Tongue" /&gt;&lt;/P&gt;&lt;P&gt;kudoos on making the labs , i find it very useful to fasttrack my learning. the power point is also very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now that i have your attention i'd like to pick your brains about dictionaries:&lt;/P&gt;&lt;P&gt;Can you give me a simple senario where saving data to dictionaries is useful / like what kind of data?&lt;/P&gt;&lt;P&gt;i reckon i can store any nessary data i need within variable memory in run time.&lt;/P&gt;&lt;P&gt;\\ saving data to entities seems very much like an GIS application. i rekon i can expose the dictionary in an interface to allow users to append data to entities and make autcad behave like gis software&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hey thx _gile for taking a look.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 18:16:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567110#M54104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T18:16:14Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567112#M54105</link>
      <description>&lt;P&gt;-gile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the learner is learing at great pace. &amp;nbsp;forgive his ignorance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;btw - the trycast did not correct my problem&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 18:22:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567112#M54105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T18:22:38Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567196#M54106</link>
      <description>&lt;P&gt;theEntity,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if I offend you, this was not at all my intention (&lt;SPAN&gt;appologies for my poor English too).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The TryCast() method try to cast the DBObject returned by GetObject() in the specified type (Curve) and returns Nothing if the cast fails.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then this is checked with the "IsNot Nothing" expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;If ent IsNot Nothing AndAlso ent.ExtensionDictionary.IsValid Then&lt;/PRE&gt;&lt;P&gt;This works fine for me and correct the 'bug' I reported.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you still have a problem, please tell how it occurs (which command is running and what you're doing in the autoCAD Editor) and which code line fires the exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;About Dictionaries, they're usefull to store data within the Database (NOD children) or within a DBObject (extension dictionaries). These data will be available after closing and re-opening the drawing.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 19:14:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567196#M54106</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-08-06T19:14:58Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567232#M54107</link>
      <description>&lt;P&gt;yes thanks _gile &amp;nbsp; . no offence taken&lt;/P&gt;&lt;P&gt;i learn myself and have only the forum to help if i get stuck. &amp;nbsp;i understand casting but the solution is more apparent&amp;nbsp;for you because you have lots of experience&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i made the change you suggest and it seems to validate correctly now..&lt;/P&gt;&lt;P&gt;much thx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 19:33:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567232#M54107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T19:33:31Z</dc:date>
    </item>
    <item>
      <title>Re : .NET training labs</title>
      <link>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567360#M54109</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Another way (cheaper because the entity type is checked befor opening it) is to use the ObjectId.ObjectClass property:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;    Public Sub MyInputMonitor(ByVal sender As Object, ByVal e As PointMonitorEventArgs)

        ' first lets check what is under the Cursor
        Dim fullEntPath() As FullSubentityPath = e.Context.GetPickedEntities()
        ' create a RXClass instance for the Curve class
        Dim curveClass As RXClass = RXClass.GetClass(GetType(Curve))
        ' check if there's something under the cursor and if it's derived from Curve
        If fullEntPath.Length &amp;gt; 0 AndAlso _
            fullEntPath(0).GetObjectIds(0).ObjectClass.IsDerivedFrom(curveClass) Then

            ' start a transaction
            Dim trans As Transaction = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction
            Try

                ' open the Entity for read, we  already know it's a Curve
                Dim ent As Curve = trans.GetObject(fullEntPath(0).GetObjectIds(0), OpenMode.ForRead)

                ' ok, so if we are over something - then check to see if it has an extension dictionary
                If (ent.ExtensionDictionary.IsValid) Then

                    ' ...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 20:41:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/net-training-labs/m-p/3567360#M54109</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2012-08-06T20:41:55Z</dc:date>
    </item>
  </channel>
</rss>

