Author Topic: Search for nested anonymous blocks  (Read 3974 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Search for nested anonymous blocks
« Reply #15 on: August 02, 2016, 02:59:39 AM »
My suggestion:

Roy, be aware that your functions KGA_Conv_Pickset_To_EnameList & nestedEnmList are adding unnecessary loops to the processing and therefore introducing inefficiency.
Every block is analysed only once, so I don't think there are unnecessary loops. But the lists that are returned by these functions do entail some overhead. Maybe that is what you mean?
« Last Edit: August 02, 2016, 03:15:36 AM by roy_043 »

David Bethel

  • Swamp Rat
  • Posts: 656
Re: Search for nested anonymous blocks
« Reply #16 on: August 02, 2016, 06:41:05 AM »

Thanks for the info

When you step through the block table, you can get the 'block' entity by
(tblobjname "block" <block name>)
Then code 330 is the 'block record'
Then you can look right after code '(102 . "{BLKREFS")' at code 331, these are inserts of the block.
Once you get those inserts, then you can check code '330' the 'block record'
To see if there is a '340' which would be the layout.

(tblobjname) didn't come around until ACAD 2000
group 330 by ACAD 2004

It is good to know though  :idea:

-David
R12 Dos - A2K

Lee Mac

  • Seagull
  • Posts: 12923
  • London, England
Re: Search for nested anonymous blocks
« Reply #17 on: August 02, 2016, 03:21:46 PM »
My suggestion:

Roy, be aware that your functions KGA_Conv_Pickset_To_EnameList & nestedEnmList are adding unnecessary loops to the processing and therefore introducing inefficiency.
Every block is analysed only once, so I don't think there are unnecessary loops. But the lists that are returned by these functions do entail some overhead. Maybe that is what you mean?

KGA_Conv_Pickset_To_EnameList iterates over the selection set only to construct a list which is then iterated using another loop; similarly, nestedEnmList iterates over the block components only to construct a list which is then iterated to check for INSERT entities - this check and any further processing could be performed whilst iterating over the block components to avoid the extra processing loop.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Search for nested anonymous blocks
« Reply #18 on: August 02, 2016, 04:42:12 PM »
... avoid the extra processing loop.
OK, so I have understood you correctly. Mind you this overhead is minute compared to the overhead I have referred to earlier. And of course BricsCAD has a built-in function vle-selectionset->list. Using that instead of my KGA_Conv_Pickset_To_EnameList would make this overhead even smaller.