Author Topic: Annoying "Scaning the drawing" when removing VIEW's  (Read 2139 times)

0 Members and 1 Guest are viewing this topic.

kruuger

  • Swamp Rat
  • Posts: 637
Annoying "Scaning the drawing" when removing VIEW's
« on: November 22, 2013, 04:06:01 PM »
hello

i'm removing VIEW's inside my program (under dcl). with this code:
Code: [Select]
(defun ads:001_RemoveUcsView (Mode / adoc)
  (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object)))
  (foreach %1
    (list
      (vla-Get-Views adoc)
      (vla-Get-UserCoordinateSystems adoc)
    )
    (vlax-for %2 %1
      (if
        (and
          (if Mode
            T
            (not (member (vla-get-name %2) (mapcar (quote cdr) (mapcar (quote car) *lst))))
          )
          (= "001_MVP_" (substr (vla-get-name %2) 1 8))
        )
        (vl-catch-all-apply 'vla-delete (list %2))
      )
    )
  )
)
every time when i run this code autocad start processing something in modemacro line (Scanning the drawing...).
with larger drawing it is very annoying and time consuming.
is there any trick to avoid this ? command is fine before dcl but not when i'm inside dialog.

thanks
kruuger

kruuger

  • Swamp Rat
  • Posts: 637
Re: Annoying "Scaning the drawing" when removing VIEW's
« Reply #1 on: November 26, 2013, 05:58:05 PM »
i think i will temporary close the dialog, delete VIEW's with command and restore dcl state.
it will be 100x faster than VLA approach.
kruuger

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Annoying "Scaning the drawing" when removing VIEW's
« Reply #2 on: November 27, 2013, 10:20:14 AM »
Does the drawing have any indexing turned on, or are you running a third-party plug-in which may be reacting to certain drawing changes?

Then again - should you be deleting items from a collection as you are iterating it?
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

kruuger

  • Swamp Rat
  • Posts: 637
Re: Annoying "Scaning the drawing" when removing VIEW's
« Reply #3 on: November 27, 2013, 03:17:58 PM »
Does the drawing have any indexing turned on, or are you running a third-party plug-in which may be reacting to certain drawing changes?

Then again - should you be deleting items from a collection as you are iterating it?
i think it is a bug. just create few views (10-20) a try this:


Code: [Select]
(vlax-for % (vla-Get-Views (vla-get-ActiveDocument (vlax-get-acad-object)))
  (vla-delete %)
)


i try on few station with different configuration, cad version and autocad always "Scanning the drawing" :(
kruuger

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Annoying "Scaning the drawing" when removing VIEW's
« Reply #4 on: November 27, 2013, 04:43:48 PM »
For me, using your drawing, the  "Scanning the drawing" is shown .. but it still processes very fast.

For interest in your production drawings is a layer filter set or are you showing ALL ?

apparently SHOWLAYERUSAGE other than OFF also affects the process ( from my quick reading)

Personally I wouldn't delete objects from a collection while iterating the collection ; I'd make a list of the objects I want to process.
This may be just my paranoia kicking in 'cause I don't recall how vlax-for works internally.
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.

kruuger

  • Swamp Rat
  • Posts: 637
Re: Annoying "Scaning the drawing" when removing VIEW's
« Reply #5 on: November 27, 2013, 05:14:28 PM »
For me, using your drawing, the  "Scanning the drawing" is shown .. but it still processes very fast.

For interest in your production drawings is a layer filter set or are you showing ALL ?

apparently SHOWLAYERUSAGE other than OFF also affects the process ( from my quick reading)

Personally I wouldn't delete objects from a collection while iterating the collection ; I'd make a list of the objects I want to process.
This may be just my paranoia kicking in 'cause I don't recall how vlax-for works internally.
this VIEW issue is related to my program (still looking for someone):
http://www.theswamp.org/index.php?topic=45664.0


if you see new sample (only 4 layout, maybe 30 views) scanning is very annoying and this is rather very small shop drawing.
i think the same problem is with deleting UCS.


BTW Kerry, i spoke with G.S. very nice guy. maybe he can take this.


kruuger