2005: Scanning the drawing...

Discussion in 'AutoCAD' started by Laurie Comerford, Sep 11, 2004.

  1. Hi Nick,

    With VBA there seems to be very little point in changing layers within the
    code.

    Guessing that you are doing this so that objects are drawn on the correct
    layer, you are better off drawing the object and then assigning it layer.

    Set oLine = ThisDrawing.ModelSpace.AddLine (Pt1, Pt2)
    With oLine
    .Layer = MyLayer
    Set any other characteristics here as well if needed
    End With


    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au

    lower-left-hand corner of the system AutoCAD window says "Scanning the
    drawing...". Then a progress bar displays to the right of the message.
    Afterwards, the layer dialog appears.
    dialog. Now, in 2005, this message appears everytime a layer command is
    invoked, even if the dialog is not displayed.
    current layer, this message and progress bar gets invoked automatically. It
    usually takes a couple of seconds for it to complete its "Scanning...". This
    process slows down some of the functions running in my VL app', which makes
    the app' run slower overall, as a result of this "Scanning the drawing..."
    message.
     
    Laurie Comerford, Sep 11, 2004
    #1
  2. My VL app' contains functions that have to monitor and sometimes adjust the current layer based on the processing that's being done.

    In all previous versions of AutoCAD, those functions executed like lightning. However, now that I'm testing my app' with 2005, I've discovered a significant loss of processing speed whenever the current layer is changed. The "Scanning the drawing..." repeatedly gets invoked.

    Is there any way to turn this off, or am I doomed to having to re-write some of my code?
     
    Nick_Merchant, Sep 11, 2004
    #2
  3. Laurie Comerford

    Doug Broad Guest

    Not enough info to answer question.


    I've discovered a significant loss of processing speed whenever the current layer is changed. The "Scanning the drawing..."
    repeatedly gets invoked.
     
    Doug Broad, Sep 11, 2004
    #3
  4. Anytime you enter the layer dialog, a messge which displays at the lower-left-hand corner of the system AutoCAD window says "Scanning the drawing...". Then a progress bar displays to the right of the message. Afterwards, the layer dialog appears.

    In previous versions of AutoCAD, this only happenned when entering the dialog. Now, in 2005, this message appears everytime a layer command is invoked, even if the dialog is not displayed.

    The problem I'm having is that anytime my app' changes the setting of the current layer, this message and progress bar gets invoked automatically. It usually takes a couple of seconds for it to complete its "Scanning...". This process slows down some of the functions running in my VL app', which makes the app' run slower overall, as a result of this "Scanning the drawing..." message.

    I need to find a way to bypass this message when I change layers or lock layers, etc. using VL.

    Does that clarify my original post at all?
     
    Nick_Merchant, Sep 11, 2004
    #4
  5. Hi Laurie,

    More testing showed that it's actually the adjustment of the status of any particular layer. For instance if I need to lock particular layers or turn others off or thaw some others, then the scanning occurs.

    I was mistaken when I stated that it was the change of the current layer setting that invoked the scanning.

    BUT, I do like your suggestion. Even though I don't think it's a solution to the problem I'm having right now, it's a great idea, nonetheless.

    That's the was it should be done anyway. Create the object and assign the layer property during the creation.
     
    Nick_Merchant, Sep 11, 2004
    #5
  6. Laurie Comerford

    Doug Broad Guest

    Nick,
    It would help if you post a very small portion of the code
    that causes the problem. I have noticed practically every
    program that uses the command structure of AutoCAD
    has slowed down with 2005 by a factor of 6 or more.

    Regards,
    Doug


    particular layers or turn others off or thaw some others, then the scanning occurs.
     
    Doug Broad, Sep 11, 2004
    #6
  7. Thanks for taking the time to reply Doug. Here's a tiny example of what I'm talking about:

    ( command "layer" "thaw" "0" "on" "0" "unlock" "0" "" )

    This fragment causes the "Scanning..." in 2005, even though it does NOT inoke the layer dialog.

    However, this same fragment will NOT cause drawing scanning in pre-2005 AutoCAD. The ONLY time the "Scanning..." occurs is when you explicitly call the layer dialog.

    Please try this in a drawing editor and it should be pretty obvious what I'm taking about.

    I really don't know how to make this any more clear.
     
    Nick_Merchant, Sep 12, 2004
    #7
  8. Laurie Comerford

    Doug Broad Guest

    Yes Nick.
    I can see that also but it flashes by too quickly to see unless
    the drawing is moderate in size.

    To avoid that note flashing by in the status line, you must
    translate many if not most of your command calls to
    ActiveX statements that do the same thing.

    This is a very unfortunate side effect of the changes in 2005
    IMO and I hope that Autodesk will remedy this situation
    by providing some sort of operational shift when a LISP program
    is operating. It is most likely occuring because of some sort
    of new layering reactor built-in to the program.

    A sample code that would perform similar functions is:

    (defun c:test ()
    (setq doc (vla-get-activedocument
    (vlax-get-acad-object))
    layers (vla-get-layers doc)
    layer (vla-item layers "0"))
    (vla-put-layeron layer :vlax-true)
    (if (not (equal layer (vla-get-activelayer doc)))
    (vla-put-freeze layer :vlax-false))
    (vla-put-lock layer :vlax-false))

    ;if you try to change the freeze/thaw status of the activelayer,
    ;it causes an error.

    you explicitly call the layer dialog.
     
    Doug Broad, Sep 12, 2004
    #8
  9. Doug,

    Once again, I really appreciate your taking the time to reply to this post and assist me.

    You have verified my unspoken suspicion that the solution lay somewhere in ActiveX functionality. Your suggested remedy was going to be my next step.

    It seems that, as you implied, to keep my code running efficiently I'm going to eventually have to replace all of the ( command ) calls in my entire app' with the ActiveX equivalent.

    I suspect that waiting for Autodesk to remedy this would be a rather lengthy wait, so I won't hold my breath on it.

    Thanks again!
     
    Nick_Merchant, Sep 12, 2004
    #9
  10. Laurie Comerford

    Joe Burke Guest

    Nick,

    Replacing all command calls is a good idea regardless of issues related to 2005.

    Your programs will be faster in all A2x versions. How much faster depends on your
    code. But it's not unusual to see a 30x speed improvement.

    Joe Burke
     
    Joe Burke, Sep 12, 2004
    #10
  11. FWIW, I don't see it unless I invoke the dialog.
    Perhaps my files are not large enough?
     
    Jason Piercey, Sep 12, 2004
    #11
  12. You're absolutely right, Joe.

    In fact I have been in the process of transitioning the code in just that way over the past 2 months. As a result, I have seen dramatic increases to processing speed overall.

    I had been doing it on priority need-type basis. However, the 2005 testing with my app' has now revealed yet another need for ActiveX.

    Eventually, there will be no ( command ) calls anywhere. It's just gonna' take some time though. Compiled, the resulting vlx is almost a Meg. The source is 4 Meg.

    It's always a daunting task enhancing the efficiency of the code without introducing bugs in the process, so I've really gotta' be careful if I want my clients to remain happy.
     
    Nick_Merchant, Sep 12, 2004
    #12
  13. Hi Jason,

    Your assumption is right. Like Doug mentioned, the drawing has to contain enough layers and objects to be able to see it.
     
    Nick_Merchant, Sep 12, 2004
    #13
  14. Laurie Comerford

    Joe Burke Guest

    Jason and Doug,

    Just curious... do you think this has anything to do with file size? Or is it simply
    a function of how many layers are involved? I tend to think the latter, but I may be
    wrong.

    Using 2004 here.

    Joe Burke
     
    Joe Burke, Sep 13, 2004
    #14
  15. Hi Joe,

    I'll have to say file size. Just created a 'blank' file
    with 1000 layers (should be sufficient?) and still
    no sign of the scanning.
     
    Jason Piercey, Sep 13, 2004
    #15
  16. Laurie Comerford

    Doug Broad Guest

    File size and layer complexity will probably both affect
    the duration of the message but file size primarily.
    I opened the sample architectural desktop project and
    for that project it blinks but if the layer setting comman was
    in a loop it might appear to persist.

    In any case, such a model space scanning operation would
    affect a command based lisp program adversly.

    Regards,
    Doug
     
    Doug Broad, Sep 13, 2004
    #16
  17. Laurie Comerford

    Joe Burke Guest

    Thanks Jason.

    Apparently file size matters, and I don't understand what's going on under the hood.

    Joe Burke
     
    Joe Burke, Sep 13, 2004
    #17
  18. Marc'Antonio Alessi, Sep 13, 2004
    #18
  19. Nope. Still don't see it, even with the boat-load of
    layer filters defined.
     
    Jason Piercey, Sep 13, 2004
    #19
  20. Jimmy Bergmark, Sep 14, 2004
    #20
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.