Author Topic: SymbolTable Iteration, Enumeration  (Read 11975 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: SymbolTable Iteration, Enumeration
« Reply #15 on: May 10, 2007, 12:09:19 AM »
Ta Dan !
Fixed.

Typing up Some of the C++ Managed I've seen would ruin my old wrists ... not to mention the gray wet stuff.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: SymbolTable Iteration, Enumeration
« Reply #16 on: May 10, 2007, 12:30:28 AM »
Has anyone come across a quick way to count the Symbol Table entries .. other than iterating and +=

.. I feel like I'm missing something thats probably obvious ..  :|
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: SymbolTable Iteration, Enumeration
« Reply #17 on: May 10, 2007, 04:11:29 AM »
Has anyone come across a quick way to count the Symbol Table entries .. other than iterating and +=

.. I feel like I'm missing something thats probably obvious ..  :|

It is some sort of resbuf chain, I would say you would have to iterate through to get the count

Dan

edit: butter fingers
« Last Edit: May 10, 2007, 04:39:04 AM by Danielm103 »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: SymbolTable Iteration, Enumeration
« Reply #18 on: May 10, 2007, 04:17:19 AM »
Thanks Dan, no, really :-)
I feared as much !
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: SymbolTable Iteration, Enumeration
« Reply #19 on: May 10, 2007, 04:43:02 AM »
Thanks Dan, no, really :-)
I feared as much !

Doesn’t VB have some sort of   “Get friendly Dim count of enumerated container thingy method”?
« Last Edit: May 10, 2007, 04:46:27 AM by Danielm103 »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: SymbolTable Iteration, Enumeration
« Reply #20 on: May 10, 2007, 04:49:11 AM »

Doesn’t VB have some sort of   “Get friendly Dim count of enumerated container thingy method”?

>>  thingy method ?

I hate those VB technical terms  :D
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Paul Richardson

  • Guest
Re: SymbolTable Iteration, Enumeration
« Reply #21 on: May 10, 2007, 09:41:12 AM »
Very nice! but where are all your pretty aliases, like
Code: [Select]
using AcRx = Autodesk.AutoCAD.Runtime;
These ??
Code: [Select]
#region usingAliases

// Shortcuts to the managed classes ..
using AcAp = Autodesk.AutoCAD.ApplicationServices;   
using AcCo = Autodesk.AutoCAD.Colors;               
using AcDb = Autodesk.AutoCAD.DatabaseServices;   
using AcEd = Autodesk.AutoCAD.EditorInput;
using AcGe = Autodesk.AutoCAD.Geometry;
using AcGi = Autodesk.AutoCAD.GraphicsInterface;
using AcLy = Autodesk.AutoCAD.LayerManager;
using AcPl = Autodesk.AutoCAD.PlottingServices;
using AcRx = Autodesk.AutoCAD.Runtime;
using AcWin = Autodesk.AutoCAD.Windows;

using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;

#endregion
I wish C++/CLI had the ability to do this aliasing.

Me too! :(

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel

Paul Richardson

  • Guest

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: SymbolTable Iteration, Enumeration
« Reply #24 on: May 10, 2007, 10:20:26 AM »
I also wanted to share with you, that sometimes, 
if you comment the #includes intellisence begins to work.. sometimes.. 

Paul Richardson

  • Guest
Re: SymbolTable Iteration, Enumeration
« Reply #25 on: May 10, 2007, 10:32:44 AM »
I also wanted to share with you, that sometimes, 
if you comment the #includes intellisence begins to work.. sometimes.. 

Thanks, We'll get it. I'm going to play this weekend.

Also I tried the "Whole Tomato" but it is just overkill! Not too bad with C++ but when you open C# it's just a mess of data being suggested by intellisense - I uninstalled it...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: SymbolTable Iteration, Enumeration
« Reply #26 on: May 11, 2007, 04:40:39 AM »
Just because it seems to make more sense to use the BlockTableRecord Properties,
I changed this in the BLOCK Lister:
Code: [Select]
                       if (!(btr.Name.StartsWith("*")))
                            ed.WriteMessage("\nBlock name: {0}", btr.Name);

to this:
Code: [Select]
                        // exclude the P' and M'Spaces and anonomous blocks
                        if (!(btr.IsAnonymous || btr.IsLayout))
                            ed.WriteMessage("\nBlock name: {0}", btr.Name);

PICCY ADDED:
« Last Edit: May 11, 2007, 04:59:06 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Draftek

  • Guest
Re: SymbolTable Iteration, Enumeration
« Reply #27 on: May 11, 2007, 08:15:14 AM »
Very nice! but where are all your pretty aliases, like
Code: [Select]
using AcRx = Autodesk.AutoCAD.Runtime;
These ??
Code: [Select]
#region usingAliases

// Shortcuts to the managed classes ..
using AcAp = Autodesk.AutoCAD.ApplicationServices;   
using AcCo = Autodesk.AutoCAD.Colors;               
using AcDb = Autodesk.AutoCAD.DatabaseServices;   
using AcEd = Autodesk.AutoCAD.EditorInput;
using AcGe = Autodesk.AutoCAD.Geometry;
using AcGi = Autodesk.AutoCAD.GraphicsInterface;
using AcLy = Autodesk.AutoCAD.LayerManager;
using AcPl = Autodesk.AutoCAD.PlottingServices;
using AcRx = Autodesk.AutoCAD.Runtime;
using AcWin = Autodesk.AutoCAD.Windows;

using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;

#endregion
I wish C++/CLI had the ability to do this aliasing.

Me too! :(

ooOOOOkayyy! That explains a lot.

TonyT

  • Guest
Re: SymbolTable Iteration, Enumeration
« Reply #28 on: May 12, 2007, 04:04:44 PM »

Has anyone come across a quick way to count the Symbol Table entries .. other than iterating and +=   .. I feel like I'm missing something thats probably obvious ..  :|

Given that there's no way to do it in native ARX
without iteration, I would guess not.

Interesting side note is that many VBA/ActiveX programmers
do not have the slightest idea how horribly ineffecient code
like this is:

Code: [Select]

   AcadApplication Acad = ///

   AcadBlocks blocks = Acad.ActiveDocument.Blocks;
   for(int i = 0; i < blocks.Count; i++ )
       DoSomethingWith( blocks.Item[i] );

  
The Count property of all ActiveX symbol table wrappers
must also do exactly what you'd like to avoid :), and the
Item[] indexer must also do the same thing (to find the
element at a given index position).

« Last Edit: May 12, 2007, 04:14:05 PM by TonyT »