Author Topic: Browsing to open folder takes along time.  (Read 1374 times)

0 Members and 1 Guest are viewing this topic.

SDETERS

  • Guest
Browsing to open folder takes along time.
« on: September 07, 2005, 02:14:38 PM »
When I browse to a folder in Autocad during the open command.  One particular area of our network it takes about a minute to open that directory.  There are no files just 4 or 5 folders.  When I go through windows my computer or explorer it opens just fine.

Why would it take that long to open that folder that contains folders?  Any Ideas thanks

For Example

I go to  "file" "open"

then I go to my C: drive and then I go to c:\stuff\ 

When I try to go to Stuff the machine hangs for about a minute or 2

Edit: Killed the "shouting" title.
« Last Edit: September 12, 2005, 02:32:37 PM by MP »

sourdough

  • Bull Frog
  • Posts: 367
Re: BROWSING TO OPEN FOLDER TAKES ALONG TIME
« Reply #1 on: September 07, 2005, 08:37:19 PM »
Here is some code to open the dwg folder from withing autocad, you may need to rename the command since autocad
natively uses the same name. Here is the code a real gem.

Code: [Select]
;;  exp.lsp
;;
;;  Launches Microsoft Windows Explorer from the current drawing directory.
;;  Library Functions Used
;; NONE
;;
;;*************************************************************************************************
;;*************************************************************************************************
;;
(defun c:exp ( / cmdecho_old error_old expert_old)
;;
;;*************************************************************************************************
;;
;;  Define Error Trap Function - DO NOT EDIT!!!
;;
  (defun-q func_err (err)
    (setq err_list (list "Function cancelled"
                         "quit / exit abort"
         "console break"
   )
    )
    (if (not (member err err_list))
      (princ (strcat "\nError: " err))
    )
    (setvar "CMDECHO" cmdecho_old)
    (setvar "EXPERT" expert_old)
    (setq *error* error_old)
    (princ)
  )
  (setq cmdecho_old (getvar "CMDECHO")
        expert_old (getvar "EXPERT")
error_old *error*
*error* func_err
  )
  (setvar "CMDECHO" 0)
  (setvar "EXPERT" 1)
;;
;;*************************************************************************************************
;;
;;  Define Subroutines
;;
;;*************************************************************************************************
;;
;;  Main Code Section
;;
  (startapp "EXPLORER" (strcat "/n,/e," (getvar "DWGPREFIX")))
;;
;;*************************************************************************************************
;;
;;Restore variables for FUNC_ERR - DO NOT EDIT!!!
;;
  (setvar "CMDECHO" cmdecho_old)
  (setvar "EXPERT" expert_old)
  (setq *error* error_old)
  (princ)
)
;;
;;*************************************************************************************************
;;*************************************************************************************************

another gem to delete layerfilters from Robert Bell, the code :

Code: [Select]
;|

;Written by: R. Robert Bell
;Purpose: Allows the user to enter a wildcard string to keep any matching filters.
;Sample string: "`#*,MW*" will keep all filters beginning with a "#" or "MW"

;Copyright © 2004 by R. Robert Bell

|;

(defun rrbI:LayerFiltersDelete  (strKeepWC / objXDict)
 ;; This function insures that an Extension Dictionary exists, and works on both locations for layer filters
 (vl-load-com)                                                                  ; load ActiveX if needed
 (vl-catch-all-apply                                                            ; trap error if no extension dictionary
  (function
   (lambda ()
    (setq objXDict (vla-GetExtensionDictionary                                  ; bind dictionary to variable
                    (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))))))))
 (cond (objXDict                                                                ; if the extension dictionary exists
        (or                                                                     ; use OR to return T for success
         (rrbI:DeleteAllXRecs objXDict "ACAD_LAYERFILTERS" strKeepWC)           ; pre-2005 layer filters
         (rrbI:DeleteAllXRecs objXDict "AcLyDictionary" strKeepWC)))))          ; 2005 layer filters

(defun rrbI:DeleteAllXRecs  (objXDict dictName strKeepWC / objDict i)
 ;; This function performs the chore of deleting each filer that doesn't match the wildcard
 (vl-catch-all-apply                                                            ; trap errors
  (function
   (lambda ()
    (setq objDict (vla-Item objXDict dictName))                                 ; get layer filters dictionary
    (vlax-for objXRec  objDict                                                  ; loop thru all XRecords in the dictionary
     (cond ((not (and strKeepWC (wcmatch (vla-Get-Name objXRec) strKeepWC)))    ; if deleting all filters, or current doesn't match wildcard
            (setq i (1+ (cond (i)                                               ; increment counter
                              (0))))                                            ; initialize counter
            (vla-Delete objXRec)))))))                                          ; delete filter
 (cond (i (princ (strcat "\n" (itoa i) " filters deleted.")))))                 ; if counter is bound, report number of filters deleted

(defun C:LFD  (/ inpKeep)
 ;; Main command-line function
 (setq inpKeep (getstring
                "\nWildcard mask for filters to keep, or <Enter> to delete all: "))
 (rrbI:LayerFiltersDelete (cond ((/= inpKeep "") inpKeep)))                     ; pass nil to subr if user hit <Enter>
 (princ))                                                                       ; clean exit



It is related so I hope it helps.

« Last Edit: September 07, 2005, 08:43:03 PM by sourdoug »
LDC 2009/C3D 2010/C3D 2011/C3D 2016

Win 10 64bit

SDETERS

  • Guest
Re: BROWSING TO OPEN FOLDER TAKES ALONG TIME
« Reply #2 on: September 08, 2005, 08:20:22 AM »
This work great

Is there any way of going to a specific folder when I open up explorer with in Autocad?

It always goes to my home directory


Thanks

Shane

whdjr

  • Guest
Re: BROWSING TO OPEN FOLDER TAKES ALONG TIME
« Reply #3 on: September 08, 2005, 08:28:16 AM »
Shane do you have a lot of images in the folder that you are opening.  I know they wouldn't show up in the Acad dialog box, but we had some images in one of our root folders and the open menu was having to read each of those before it determined to display it or not; hence our slow down.

HTH,

SDETERS

  • Guest
Re: BROWSING TO OPEN FOLDER TAKES ALONG TIME
« Reply #4 on: September 08, 2005, 08:33:23 AM »
No files what so ever.  Just 5 or 6 folders

It works well on other file folders within this drive

it is just this one that is giving my computer fits.

The lisp routine is a great work around until we figure out what is going on with this folder

Thanks for all the input
Everyone is really smart and great on this site

deegeecees

  • Guest
Re: BROWSING TO OPEN FOLDER TAKES ALONG TIME
« Reply #5 on: September 08, 2005, 04:00:30 PM »
Sounds like a network problem.

But if Sourdougs' proggy is working, maybe not.
In answer to your Q:

(startapp "EXPLORER" (strcat "/n,/e," (getvar "DWGPREFIX")))

Change this line to match your needs.
« Last Edit: September 08, 2005, 04:06:18 PM by deegeecees »

cparnell

  • Guest
Re: Browsing to open folder takes along time.
« Reply #6 on: January 06, 2006, 06:06:36 PM »
sourdoug:

I like your Windows Explorer routine and it works well, however it seems that if a file path contains too many coma's, just my guess,  that it gets an error message. File path below:

Q:\Client\Shaw's\SO 103755 Newtonville, MA (4) MDC-6-58LN-26-EC, (2) MDC-8-58LN-26-G Gondola\(4) MDC-6-58LN-26-EC, (2) MDC-8-58LN-26-G Gondola.dwg

Do you have any ideas what might be causeing this problem, or if the routine can be modified.
I attached a file by the name of, Windows Explorer dwgprefix.doc that shows the error message that I get when I try this routine.
Thanks for your time and any help that you can offer.

pmvliet

  • Guest
Re: Browsing to open folder takes along time.
« Reply #7 on: January 09, 2006, 02:17:38 PM »
what is in the 4 or 5 folders below? a lot of stuff?

cparnell

  • Guest
Re: Browsing to open folder takes along time.
« Reply #8 on: January 09, 2006, 02:47:28 PM »
pmvliet:

Yes, a lot of different file types, CAD, Excel, .PDF's etc