Author Topic: Using a temporary computer & ACAD system?  (Read 11483 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Using a temporary computer & ACAD system?
« on: March 16, 2010, 11:44:49 PM »
Due to the economy I am going to take so temporary drafting work in my area.
Doing what I normally do but on another computer.
I have quite a few LISP routines I regularly use, a menu system, and my drawing variable set up.
On my computer I use acaddoc.lsp to run AlansAutoload.lsp which loads my lisp routines.
Also run ACADSet_Variables CAB.lsp which sets all the vars the way I like them.
My menu is already installed but in case something happens to it I have this routine to reload it.
Code: [Select]
(defun c:MyMenu()
  (command "menuunload" "CAB1")
  (command "menuload" "C:/CABs Menus/CAB1.mns")
  (menucmd "P17=+CAB1.POP1")
  (princ)
)
The question is how to make use of my favorites without leaving them on the temporary system?
Never having to do this before I would hope that I could use a thumb drive & add it to the ACAD path.
If they have a network will this be a problem?  Don't have any idea at this point what version of ACAD is in use.


List of things to have on the thumb drive:
My Lisp routines
Menu file
All ICONS, this will be a PITA gathering them up & making them work.

A lisp routine to run and do the set up for me. Or should I manually alter the system? (save profile & set my profile)

A lisp routine to restore the system & clean my stuff out. (restore profile)

So looking for ideas and suggestions. 
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Using a temporary computer & ACAD system?
« Reply #1 on: March 17, 2010, 12:04:39 AM »

Alan

I'd leave everything of yours on the thumbDrive.

Load all your autoStart stuff from your MNL file associated with your Menu.

In Options, add the thumbDrive folders as required. ( could be done from your autoload stuff < thats what I'd do anyway>)


the menu will load automatically if it's available ... after that it's all magic. :)

//-------------
great to hear you've picked up some extra :)
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.

matthewj

  • Newt
  • Posts: 42
  • Vanilla
Re: Using a temporary computer & ACAD system?
« Reply #2 on: March 17, 2010, 12:33:41 AM »
I used to use a thumbdrive much the same way at work a while ago.  But I never had it set up in such an automatic way.  You should be able to use AutoCAD's command line switches (/b & /p) to load a profile and/or startup script located on the thumbdrive.  I don't use custom icons, so I don't have enough experience to know this would meet those needs.

One problem with this, sometimes you don't know which drive letter windows will assign to a flash drive, this can make customizing some things a hassle.  I've been using the following script to take care of this problem.  Its a batch file that "mounts" the directory it is run in as drive Z:/.  Run it once to mount the directory, and run it again to remove the mount.

Code: [Select]
@echo off
if "%MAPX%"=="" setx mapx 0

:trial
if "%MAPX%"=="1" goto :unmapx
goto :mapx
goto :end

:mapx

echo Mapping drive Z:/
REM Map current directory to drive Z:
subst z: "%cd%"

setx MAPX 1

goto :end

:unmapx

echo Unmapping drive Z:/
REM move to a different directory
cd c:

REM unmap current drive z:
subst z: /d

setx MAPX 0

goto :end

:end

(This is totally not a commercial, but) I recently started using dropbox, an online synced storage, to share all of my acad customization files and profiles between my work and home computers.  It's been working like a charm for the past year or so.  Of course this would mean leaving a copy of the files on the work computer until you uninstalled the sync program.  (Which does not seem like it would fit your bill, but then again, it might.)  This might work out in a longer term temp position, but probably wouldn't be worth the hassle in a short term gig.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Using a temporary computer & ACAD system?
« Reply #3 on: March 17, 2010, 07:45:53 AM »
One thing is to load the support path to the icons BEFORE loading the menu so that they will show when the menu is loaded.  I typically run most of my development off of my thumb drive so that I can take it home and  use it there.

map a drive and use that mapped drive for all of you custom stuff, like matthewj said, leave it all on the thumb drive.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #4 on: March 17, 2010, 08:13:04 AM »
Thanks for all the advice.
I will test the setup on my system later today. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Re: Using a temporary computer & ACAD system?
« Reply #5 on: March 17, 2010, 08:45:43 AM »
Icons:
http://afralisp.net/vbaa/vbadll.htm
Use a dll. It's what i use.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #6 on: March 17, 2010, 09:16:51 AM »
That would be a great way to tidy up but figuring out which icons I need will be the trick as I have not been good at deleting the unused ones and some were stored in MyDocuments which contain other unwanted picture files.
Can-o-worms :oops:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Re: Using a temporary computer & ACAD system?
« Reply #7 on: March 17, 2010, 09:20:20 AM »
So toss them all in there (thats what i did *lol*).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Using a temporary computer & ACAD system?
« Reply #8 on: March 17, 2010, 09:24:25 AM »
The question is how to make use of my favorites without leaving them on the temporary system?

If the underlying issue issue one of security I'd mount a pass worded truecrypt drive and then use a profile that utilizes same. However, I personally wouldn't worry too much about anyone ripping routines. As for dropbox, I'd be careful with services like that. Omnidrive used to be quite the rage, then *poof* they were gone, leaving a lot of people wailing and gnashing and calling for the developer's head.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #9 on: March 17, 2010, 10:08:34 AM »
Thanks Michael.
The only scenario I wish to avoid is leaving all my lisp files if I get a call that we no longer need your services.
So an unprotected thumb drive should do the trick.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #10 on: March 17, 2010, 10:12:59 AM »
Kerry,
How do you run the MNL file?


I wish this was extra. The housing market is so bad I have no work. I have not been an employee since 1977. :-(
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Using a temporary computer & ACAD system?
« Reply #11 on: March 17, 2010, 10:13:56 AM »
Thanks Michael.
The only scenario I wish to avoid is leaving all my lisp files if I get a call that we no longer need your services.
So an unprotected thumb drive should do the trick.
Provided they allow you to use it.  Our IT department has USBs disabled (except for mice and keyboards).   :|
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

JCTER

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #12 on: March 17, 2010, 10:15:51 AM »
Thanks Michael.
The only scenario I wish to avoid is leaving all my lisp files if I get a call that we no longer need your services.
So an unprotected thumb drive should do the trick.
Provided they allow you to use it.  Our IT department has USBs disabled (except for mice and keyboards).   :|

They came first for the USB ports and I said nothing, because my mic didn't work. :(

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #13 on: March 17, 2010, 11:45:58 AM »
OK, I think I conquered the issue of locating the needed bmp files.
Code: [Select]
;;  by CAB
;;  reads a MNS file and creates a text file listing all bmp file names found
(defun c:MyIcons (/ file path ICON_lst fn ln data ptr LineStr MNSfile OutFile)
  (setq MNSfile "CAB1.mns"
OutFile "Icons.txt")
  
  ;;  return a list of text string for each line in the file
  (defun ReadFile (fname / fn ln AllLines)
    (if (setq fn (findfile fname)) ; only if the file is found
      (progn ; fn contains the full path
(setq fn (open fn "r")) ; open file for reading
(while (setq ln (read-line fn)) ; read all the lines in the file
 (setq AllLines (cons ln AllLines))
)
(close fn) ; close the open file handle
      )
    )
    AllLines
  )

  ;;  parser by CAB single character delim, match ","
  (defun sparser (str delim / ptr lst)
    (while (setq ptr (vl-string-search delim str))
      (setq lst (cons (substr str 1 ptr) lst))
      (setq str (substr str (+ ptr 2)))
    )
    (reverse (cons str lst))
  )

  ;;  Read the MNS file looking for the first bmp in each line
  ;;  add the bmp to the list
  ;;  find the second bmp in the line & add it too
  ;;  Write results to Icon.txt file
  (if (setq data (ReadFile MNSfile))
    (progn
      (setq path (vl-filename-directory (findfile MNSfile)))
      (while (setq LineStr (car data))
(setq data (cdr data))
(foreach part (sparser LineStr ",")
 (if (vl-string-search ".bmp" part)
   (progn
     (setq part (vl-string-trim "\" \t\n" part)
   part (substr part 1 (+ 4 (vl-string-search ".bmp" part)))
     )
     (setq ICON_lst (cons part ICON_lst))
   )
 )
)
      ) ; while
      (if (setq fn (open (strcat path "\\" OutFile) "w")) ; open file for writing
(progn
 (write-line (strcat "BMP files used in " MNSfile) fn)
 (write-line (strcat "Date: " (rtos (getvar 'cdate) 2 4)) fn)
 (foreach ln ICON_lst ; write all the sorted data
   (write-line (strcat ln "  ==  " (findfile ln)) fn)
 )
)
      )
      (and fn (close fn)) ; close the open file handle
      (princ (strcat "\nData File --> " (strcat path "\\" OutFile)))
    )
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
Re: Using a temporary computer & ACAD system?
« Reply #14 on: March 17, 2010, 11:52:38 AM »
Kerry,
How do you run the MNL file?


I wish this was extra. The housing market is so bad I have no work. I have not been an employee since 1977. :-(

The MNL file loads automatically with an MNU or MNS file of the same name.
I drink beer and I know things....

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Using a temporary computer & ACAD system?
« Reply #15 on: March 17, 2010, 11:56:12 AM »
Not sure if this helps you Alan?

Code: [Select]
;; Out = Filename of Output File
(defun GetBitMaps (out / lst tag) ;; Lee Mac

  (cond (  (setq f (open out "w"))
     
           (vlax-for Men (vla-get-MenuGroups (vlax-get-acad-object))
           
             (vlax-for Tool (vla-get-Toolbars Men)
               
               (vlax-for Butt Tool

                 (if (not (vl-catch-all-error-p
                            (vl-catch-all-apply (function vla-GetBitMaps)
                              (list Butt 'Small 'Large))))
                   
                   (write-line (strcat (vla-get-Name Butt) "\t" Small "\t" Large) f)))))

           (not (close f)))))


(defun c:test (/ fl)
  (vl-load-com)

  (if (and (setq fl (getfiled "Output" "" "txt" 1))
           (GetBitmaps fl))

    (startapp "notepad" fl))

  (princ))

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #16 on: March 17, 2010, 12:26:54 PM »
Thanks Lee, but not interested in ACAD's standard menu's, just my additions.
I may find a use for the routine though.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Using a temporary computer & ACAD system?
« Reply #17 on: March 17, 2010, 12:32:44 PM »
Thanks Lee, but not interested in ACAD's standard menu's, just my additions.
I may find a use for the routine though.

Of course the routine cycles through everything - you could easily add conditionals along the way to get at what you want  :-)

Just throwing it out there  :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #18 on: March 17, 2010, 12:47:06 PM »
Lee I appreciate every bit of help. :-)

So the process is like this:
Add thumb drive to "Support File Search Path"  (assuming all files are in the root folder)
At the command line enter MenuLoad CAB1 
CAB1 being the CAB1.mns file
The menu is loaded & then the MNL file is executed
In the CAB1.MNL file I would have :
Code: [Select]
(if (/= (type (load "AlansAutoLoad" "AlansAutoLoad not found")) 'STR)
  (AlansAutoLoad) ; loads everything else needed if found
)


At this time i have no pull down menus to contend with only buttons & fly-outs
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Using a temporary computer & ACAD system?
« Reply #19 on: March 17, 2010, 12:52:26 PM »
Alan,

I've probably posted this before....but if you go the route of using resource hacker and putting your bmps into a dll this will save you some time. All you need is an empty dll, reshacker.exe, and some images in the same directory :)

Code: [Select]
(defun c:reshackerscript (/ bmps dir dll dllnew file fname)
  (if (and (setq
    fname (getfiled "Select a DLL to process (BMPS must be in same directory)"
    ""
    "dll"
    8
  )
  )
  (setq dir (vl-filename-directory fname))
  (setq dll (strcat (vl-filename-base fname) ".dll"))
  (setq dllnew (strcat "NEW-" dll))
  (setq bmps (vl-directory-files dir "*.bmp"))
  (setq file (open (strcat dir "\\reshackerscript.txt") "w"))
      )
    (progn
      (write-line
(strcat "[FILENAMES]\nEXE=" dll
"\nSAVEAS=" dllnew
"\nLOG=\n\n[COMMANDS]\n"
"-delete   BITMAP,,0"
      )
file
      )
      (while (setq fname (car bmps))
(write-line
 (strcat "-addoverwrite " fname ", BITMAP," (vl-filename-base fname) ",0")
 file
)
(setq bmps (cdr bmps))
      )
      (close file)
      (alert
(strcat
 "Reshacker commandline script syntax:
 \n\n(dir)reshacker.exe -script reshackerscript.txt\n\n
 It's easiest if reshacker.exe, BMP files and reshackerscript.txt
 all reside in the same directory."
)
      )
      (command "._shell" "CMD")
    )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Using a temporary computer & ACAD system?
« Reply #20 on: March 17, 2010, 12:54:54 PM »
I think I am late to the party but May I suggest in lieu of a thumb drive that you have plug in and unplug every time you switch computers, I would suggest a external hard dive with a USB splitter cable.  That way all your stuff is in one spot and besides CAB, I have a feeling that you would have some automated routine doing half your drawing for you on this temporary computer anyway.   ^-^ :roll:
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #21 on: March 17, 2010, 12:58:23 PM »
Well, bigger is better & faster maybe. 8-) Thanks
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #22 on: March 17, 2010, 12:59:33 PM »
Ron, would the dll be windows specific?
I'm on Windows 2000.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Using a temporary computer & ACAD system?
« Reply #23 on: March 17, 2010, 01:02:59 PM »
Ron, would the dll be windows specific?
I'm on Windows 2000.


I don't think so ... but I'm not certain. Mark had a tutorial and an empty dll file he posted many moons ago that I could not find.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

deegeecees

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #24 on: March 17, 2010, 01:12:37 PM »
Well, bigger is better & faster maybe. 8-) Thanks

I use a 60GB Seagate, and a combination of Lisp/VBA for adding the drive to the support paths. The speed issue is so negligible it's hardly noticeable.

nivuahc

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #25 on: March 17, 2010, 01:20:20 PM »
Also late to the party but this is what I do;

I have all of my CAD stuff on a thumb drive (as well as TrueCrypt, the PortableApps suite with FireFox, and everything else I might want/need).

I install TrueCrypt on a machine* that I'll be working on and create an encrypted volume on the hard drive. I add the volume to my favorites, setup hotkeys to mount that volume with the provided password, and copy what I need to that mounted volume.

So when I login in the morning I do a CTRL+ALT+Up Arrow, type in my password, then launch AutoCAD. Every now and then I sync my thumb drive with what I've got stored in that hidden volume (which, btw, I give a name like .NTFilesys and place in the C:\Windows folder so prying eyes aren't tempted to delete it). All of my 'personal' stuff gets put in that volume... CAD related stuff as well as things such as PDF's that I want to reference from time to time (like the one that came with my purchase of that book on Python).

The benefits of this are that my drive letter will always be the same (G: for me, at this job) and if I get a call this evening telling me that my services are no longer needed there's nothing that I need to do. Without knowing that the volume is even there, no one is liable to try and mount it. And without knowing the password to the hidden volume within, no one is going to be able to use/rape my stuff.

* In the event that I'm unable to install TrueCrypt on a machine I just copy the executable to a folder somewhere on the hard drive and run it when I need it. Having it start up as a service in Windows just saves me a couple of steps.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Using a temporary computer & ACAD system?
« Reply #26 on: March 17, 2010, 01:41:32 PM »
Thanks Michael.
The only scenario I wish to avoid is leaving all my lisp files if I get a call that we no longer need your services.
So an unprotected thumb drive should do the trick.
Provided they allow you to use it.  Our IT department has USBs disabled (except for mice and keyboards).   :|
What you mean you aren't the IT Manager too?

I am the CAD/BIM/IT Manager here.

Seriously, I only disable USB ports on public machines (I also use Windows Steady State on such machines to restore them whenever they are rebooted).

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Using a temporary computer & ACAD system?
« Reply #27 on: March 17, 2010, 04:25:15 PM »
Kerry,
How do you run the MNL file?


I wish this was extra. The housing market is so bad I have no work. I have not been an employee since 1977. :-(

The MNL file loads automatically with an MNU or MNS file of the same name.

plus:
The folder that the .MNU, .MNL, icons etc are in does NOT need to be on the AutoCAD path. Once the MNU is loaded all related files are 'known' relative to the menu file location.

 
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.

Chris

  • Swamp Rat
  • Posts: 548
Re: Using a temporary computer & ACAD system?
« Reply #28 on: March 18, 2010, 08:21:27 AM »
I have had to work at one of our other offices in the past, and in order to overcome the temporary-ness, I had a routine that would renable the flash drive support, then I would just plug in my flash drive and run customizations from there.

Here at my office, all the customization in one folder. All I have to do is add the main path to the top of the list, and that causes the acaddoc.lsp to load, which loads everything, I have programs that load custom menus, other programs, tool palettes, etc.  And on top of all that, every one of the custom routines I use are encrypted and have a security check to see if a particular file exists in a particular location, if not, none of the programs run. (the only disadvantage to this is if your flash drive keeps changing drive letters from computer to computer.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #29 on: March 23, 2010, 11:19:43 AM »
Thanks for all the help.
As as result I moved my "AlansAutoLoad.lsp" to the CAB1.mnl file for loading.
It contains all the LOAD & AUTOLOAD commands as well as some short lisp helpers.
Then I created these lisps to copy the lisp & bmp files.
This does not address the shx & lin files which I moved manually.

I can now use the flash drive for the lisp & menu.
The problem with ACAD2000 is that the icons are not found even when the path is added to ACAD.
I don't expect to be using ACAD2000 though and the job has not materialized.
Sent out mode resumes today.

Dedicated routines, FYI.
Code: [Select]
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
;;  by CAB 3.22.2010
;;  reads a MNS file and creates a text file listing all bmp file names found
;;  and copies the bmp file to the flash drive
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
(defun c:MyIcons (/ file path ICON_lst fn ln data ptr LineStr MNSfile OutFile
                    drive msg)
  (setq MNSfile "CAB1.mns"
         OutFile "Icons.txt"
         drive   "E:\\ACAD\\"  ;  folder on the Flash Drive must exist
         )
 
  ;;  return a list of text string for each line in the file
  (defun ReadFile (fname / fn ln AllLines)
    (if  (setq fn (findfile fname)) ; only if the file is found
      (progn                                 ; fn contains the full path
         (setq fn (open fn "r"))             ; open file for reading
         (while (setq ln (read-line fn))     ; read all the lines in the file
           (setq AllLines (cons ln AllLines))
         )
         (close fn)                          ; close the open file handle
      )
    )
    AllLines
  )

  ;;  parser by CAB single character delim, match ","
  (defun sparser (str delim / ptr lst)
    (while (setq ptr (vl-string-search delim str))
      (setq lst (cons (substr str 1 ptr) lst))
      (setq str (substr str (+ ptr 2)))
    )
    (reverse (cons str lst))
  )

 
  ;;  CAB 3.19.2010
  ;;  returns a list with nil & message upon failure
  ;;  returns '(t "File Copy Completed.") when successful
  (defun xcopy (source dest)
    (cond
      ((not (setq source (findfile source))) '(nil "Source File not found."))
      ((not (vl-file-directory-p (vl-filename-directory dest)))
       '(nil "Destination folder not found."))
      ((and (findfile dest) (not (vl-file-delete dest)))
       '(nil "Destination file exist and can not be deleted."))
      ((not (vl-file-copy source dest)) "File Write Failed.")
      (t '(t "File Copy Completed."))
    )
  )

 
  ;;  Read the MNS file looking for the first bmp in each line
  ;;  add the bmp to the list' find the second bmp & add it too
  ;;  Write results to Icon.txt file & copies to the flash drive
  (if (setq data (ReadFile MNSfile))
    (progn
      (princ "\nWorking...\n")
      (setq path (vl-filename-directory (findfile MNSfile)))
      (while (setq LineStr (car data))
         (setq data (cdr data))
         (foreach part (sparser LineStr ",")
           (if (vl-string-search ".bmp" part)
             (progn
               (setq part (vl-string-trim "\" \t\n" part)
                      part (substr part 1 (+ 4 (vl-string-search ".bmp" part)))
               )
               (setq ICON_lst (cons part ICON_lst))
             )
           )
         )
      )                                      ; while
      (if (setq fn (open (strcat path "\\" OutFile) "w")) ; open file for writing
         (progn
           (write-line (strcat "BMP files used in " MNSfile) fn)
           (write-line (strcat "Date: " (rtos (getvar 'cdate) 2 4)) fn)
           (foreach ln ICON_lst              ; write all the sorted data
             (write-line (strcat ln "  ==  " (findfile ln)) fn)
                  (if (car
                       (setq msg (xcopy ln
                                         (strcat drive
                                                  (vl-filename-base ln)
                                                  (vl-filename-extension ln)))))
                    (write-line (strcat "     ***  " (cadr msg) "to " drive) fn)
                    (write-line (strcat "     -=< ERROR >=-  " (cadr msg)) fn)
                  )
           )
         )
      )
      (and fn (close fn))           ; close the open file handle
      (princ (strcat "\nData File List --> " (strcat path "\\" OutFile)))
    )
  )
  (princ)
)


;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
;;  by CAB 3.22.2010
;;  reads a LISP file and creates a text file listing all loaded routines
;;  associated with LOAD or AUTOLOAD and
;;  copies the files to the flash drive
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
(defun c:MyLisp (/ path LISP_lst fn ln data ptr1 ptr2 lsp LineStr LispFile OutFile found
                   itm drive msg)
  (setq LispFile "AlansAutoLoad.lsp" ; read this file for list of LISP files
         OutFile  "MyLisp.txt"
         drive    "E:\\ACAD\\"  ;  folder on the Flash Drive must exist
         )
 
  ;;  return a list of text string for each line in the file
  (defun ReadFile (fname / fn ln AllLines)
    (if  (setq fn (findfile fname)) ; only if the file is found
      (progn                                 ; fn contains the full path
         (setq fn (open fn "r"))             ; open file for reading
         (while (setq ln (read-line fn))     ; read all the lines in the file
           (setq AllLines (cons ln AllLines))
         )
         (close fn)                          ; close the open file handle
      )
    )
    AllLines
  )

  ;;  parser by CAB single character delim, match ","
  (defun sparser (str delim / ptr lst)
    (while (setq ptr (vl-string-search delim str))
      (setq lst (cons (substr str 1 ptr) lst))
      (setq str (substr str (+ ptr 2)))
    )
    (reverse (cons str lst))
  )
 
  (defun unique (lst / result)
    (while (setq itm (car lst))
      (setq lst    (vl-remove itm lst)
            result (cons itm result)
      )
    )
  )

  ;;  CAB 3.19.2010
  ;;  returns a list with nil & message upon failure
  ;;  returns '(t "File Copy Completed.") when successful
  (defun xcopy (source dest)
    (cond
      ((not (setq source (findfile source))) '(nil "Source File not found."))
      ((not (vl-file-directory-p (vl-filename-directory dest)))
       '(nil "Destination folder not found."))
      ((and (findfile dest) (not (vl-file-delete dest)))
       '(nil "Destination file exist and can not be deleted."))
      ((not (vl-file-copy source dest)) "File Write Failed.")
      (t '(t "File Copy Completed."))
    )
  )

 
  ;;  Read the "AlansAutoLoad.lsp" file looking for any LOAD or AUTOLOAD
  ;;  add the lisp name to the list
  ;;  Copy the LISP file to the flash drive
  ;;  Write results to "MyLisp.txt" file
  (if (setq data (ReadFile LispFile))
    (progn
      (princ "\nWorking...\n")
      (setq path (vl-filename-directory (findfile LispFile)))
      (while (setq LineStr (car data)) ; process each line
         (setq Linestr (strcase LineStr)
               data    (cdr data))
         (cond
           ((and (setq ptr1 (vl-string-search "AUTOLOAD " Linestr))
                  (or (not (or (setq ptr2 (vl-string-search ";" Linestr))
                                (setq ptr2 (vl-string-search "\"" Linestr))
                            ))
                      (< ptr1 ptr2)))
            (setq ptr1 (vl-string-search "\"" Linestr ptr1))
            (setq ptr2 (vl-string-search "\"" Linestr (1+ ptr1)))
            (setq lsp (substr Linestr (+ ptr1 2) (- ptr2 ptr1 1)))
            (if (vl-string-search ".LSP" lsp)
              (setq lsp (substr lsp 1 (- (strlen lsp) 4)))
            )
            (setq LISP_lst (cons lsp LISP_lst))
           )
           
           ((and (setq ptr1 (vl-string-search "LOAD " Linestr))
                  (or (not (or (setq ptr2 (vl-string-search ";" Linestr))
                                (setq ptr2 (vl-string-search "\"" Linestr))
                            ))
                      (< ptr1 ptr2)))
            (setq ptr1 (vl-string-search "\"" Linestr ptr1))
            (setq ptr2 (vl-string-search "\"" Linestr (1+ ptr1)))
            (setq lsp (substr Linestr (+ ptr1 2) (- ptr2 ptr1 1)))
            (if (vl-string-search ".LSP" lsp)
              (setq lsp (substr lsp 1 (- (strlen lsp) 4)))
            )
            (setq LISP_lst (cons lsp LISP_lst))
           )

         ) ; cond

         
      )  ; while

     
      (if (setq fn (open (strcat path "\\" OutFile) "w")) ; open file for writing
         (progn
           (write-line (strcat "Loaded files used in " LispFile) fn)
           (write-line (strcat "Date: " (rtos (getvar 'cdate) 2 4)) fn)
           (setq LISP_lst (vl-sort (unique LISP_lst) '<))
           (foreach ln LISP_lst              ; write all the sorted data
             (if (cond ;  .vlx .fas .lsp
                    ((setq found (findfile (strcat ln ".VLX")))
                      (setq ln (strcat ln ".VLX")))
                    ((setq found (findfile (strcat ln ".FAS")))
                      (setq ln (strcat ln ".FAS")))
                    ((setq found (findfile (strcat ln ".LSP")))
                      (setq ln (strcat ln ".LSP")))
                  )
               (progn
                 (write-line (strcat ln "  ==  " found) fn)
                  (if (car
                       (setq msg (xcopy found
                                         (strcat drive
                                                  (vl-filename-base found)
                                                  (vl-filename-extension found)))))
                    (write-line (strcat "     ***  " (cadr msg) "to " drive) fn)
                    (write-line (strcat "     -=< ERROR >=-  " (cadr msg)) fn)
                  )
              )
               (write-line (strcat ln "  ==  Not found") fn)
             )
           )
         )
      )
      (and fn (close fn))           ; close the open file handle
      (princ (strcat "\nLoaded File List --> " (strcat path "\\" OutFile)))
    )
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

deegeecees

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #30 on: March 23, 2010, 01:07:06 PM »
Quote from: CAB
The problem with ACAD2000 is that the icons are not found even when the path is added to ACAD.

IIRC, I solved that by naming the icon files with my own names instead of the generated ones Acad uses:

ID_UserButton_5 [_Button("PLOTTABS", "plottabs.bmp", "plottabs.bmp")]^C^C(LOAD"PlotTabs082306");PLOTTABS

as opposed to:

ID_UserButton_5 [_Button("PLOTTABS", "RCDA4464.bmp", "RCDATA_16_BLANK")]^C^C(LOAD"PlotTabs082306");PLOTTABS

KewlToyZ

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #31 on: March 23, 2010, 05:21:07 PM »
One of those other things when using a Thumb Drive:
Plug-in the drive
Right click on My Computer, select Manage
Go to Storage -> Disk Management
Set your Thumb drive to the desired drive letter.
Provided you have to have some routines or profiles point to a specific drive letter.
A:\ or B:\ are actually available on most machines anymore.
Preferably B:\ in case it actually has one of those useless floppies still  :ugly:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #32 on: March 23, 2010, 05:47:49 PM »
Hey, i still have a floppy drive :?, but B: is available. Great tip. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using a temporary computer & ACAD system?
« Reply #33 on: March 23, 2010, 06:42:44 PM »
Hey, i still have a floppy drive :?, but B: is available. Great tip. 8-)
My boss handed me a floppy disc the other day (had some old files on it). We laughed and I thanked him for the new coaster. :lmao: Thankfully, I found a machine in the plot room that had a floppy drive.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

LE3

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #34 on: March 23, 2010, 06:54:54 PM »
Hey, i still have a floppy drive :?, but B: is available. Great tip. 8-)
My boss handed me a floppy disc the other day (had some old files on it). We laughed and I thanked him for the new coaster. :lmao: Thankfully, I found a machine in the plot room that had a floppy drive.

i still have a portable drive for floppy discs with a usb chord.... also my thesis project it is saved on those 5-1/4" ones an many stuff saved on floppies.... yikes I am old.

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
Re: Using a temporary computer & ACAD system?
« Reply #35 on: March 23, 2010, 06:59:14 PM »
The PC im using right now (im at home) has a floppy drive too.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Using a temporary computer & ACAD system?
« Reply #36 on: March 23, 2010, 07:29:23 PM »
Hey, i still have a floppy drive :?, but B: is available. Great tip. 8-)
My boss handed me a floppy disc the other day (had some old files on it). We laughed and I thanked him for the new coaster. :lmao: Thankfully, I found a machine in the plot room that had a floppy drive.

i still have a portable drive for floppy discs with a usb chord.... also my thesis project it is saved on those 5-1/4" ones an many stuff saved on floppies.... yikes I am old.

Our first computer - 286 - had the 5¼" floppy drive. I think I was 7 or 8.

The PC im using right now (im at home) has a floppy drive too.
My home PC still has one, but it's just not a common thing anymore.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Chris

  • Swamp Rat
  • Posts: 548
Re: Using a temporary computer & ACAD system?
« Reply #37 on: March 30, 2010, 09:18:23 AM »
Whats a floppy disc?  :?



actually, I havent had a floppy drive in my last two custom built systems, and before that, I dont think I've used them since at least 2004
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

deegeecees

  • Guest
Re: Using a temporary computer & ACAD system?
« Reply #38 on: March 30, 2010, 10:48:17 AM »
I remember playing this on my Commodore 64, it used quite a bit of 5.25" floppies:

http://www.lemon64.com/?mainurl=http%3A//www.lemon64.com/games/details.php%3FID%3D427






My apologies for the thread mutation...

GDF

  • Water Moccasin
  • Posts: 2081
Re: Using a temporary computer & ACAD system?
« Reply #39 on: April 02, 2010, 02:28:26 PM »
Alan

I have successfully loaded all of my bmps into a dll for my menus (one dll per menu) since windows 95 and have not had any problems. I use reshacker.

Example of menu toolbar:

**ARCH_DIMENSIONI
[_Toolbar("Dimension Tools I", _Floating, _Hide,  225,200,1)]
[_Button("Add Dimensions for Total", ARCH_ADIM, ARCH_ADIM)]ADIM
[_Button("Set Default Dimstyle", ARCH_D1, ARCH_D1)]D1
[_Button("Dimension Linear", ARCH_LIN, ARCH_LIN)]LIN
[_Button("Dimension Base", ARCH_BAS, ARCH_BAS)]BAS
[_Button("Dimension Continue", ARCH_CON, ARCH_CON)]CON
[_Button("Dimension Equal", ARCH_DEQ, ARCH_DEQ)]DEQ
[_Button("Dimension Update", ARCH_DU, ARCH_DU)]DU
[_Button("Edit", ARCH_ET, ARCH_ET)]ET

If if have multiple version of autocad on a machine, this how I load submenus:
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PROG Menu Loader ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun PlacePROGMenu  (/ CNT)
  (setq CNT 1)
  (while (< CNT 24)
    (if (menucmd (strcat "P" (itoa CNT) ".1=?"))
      (setq CNT (1+ CNT))
      (progn (if (> CNT 2)
               (setq CNT (1- CNT))
               (setq CNT 2))
             (menucmd (strcat "p" (itoa CNT) "=+PROG.pop1"))
             (setq CNT 25)))))
(defun c:PROG  (/ ProgLoad)
  (cond ((< (distof (substr (getvar "acadver") 1 4)) 16.0)
         (setq ProgLoad (strcat ARCH#SUPF "V_15/PROG.mnc")))
        ((and (>= (distof (substr (getvar "acadver") 1 4)) 16.0)
              (< (distof (substr (getvar "acadver") 1 4)) 16.2))
         (setq ProgLoad (findfile (strcat ARCH#SUPF "V_16/PROG.mnc"))))
;;;    
        ((and (>= (distof (substr (getvar "acadver") 1 4)) 16.2)
              (< (distof (substr (getvar "acadver") 1 4)) 17.0))
         (setq ProgLoad (findfile (strcat ARCH#SUPF "V_16/PROG.cui"))))
;;;
        ((and (>= (distof (substr (getvar "acadver") 1 4)) 17.0)
              (< (distof (substr (getvar "acadver") 1 4)) 18.0))
         (setq ProgLoad (findfile (strcat ARCH#SUPF "V_17/PROG.cui"))))
;;;
        ((and (>= (distof (substr (getvar "acadver") 1 4)) 18.0)
              (< (distof (substr (getvar "acadver") 1 4)) 19.0))
         (setq ProgLoad (findfile (strcat ARCH#SUPF "V_18/PROG.cuix")))))
  (cond
    ((/= ProgLoad nil)
     (progn (command "menuunload" "PROG" "menuload" ProgLoad)
            (PlacePROGMenu)
            (princ "\n*** ---------- PROG Menu Loaded ---------- ***")))
    ((= ProgLoad nil)
     (ARCH:MsgBox2
       " Arch Program : Info"
       48
       "
     Arch Program© Alert
--------------------------------------------------------------------------------------------
     PROG Program is Not Loaded!"
       4)))
  ;;(MENUWAV)
  (princ))

« Last Edit: April 02, 2010, 02:32:42 PM by GDF »
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Using a temporary computer & ACAD system?
« Reply #40 on: April 02, 2010, 03:19:53 PM »
Thanks Gary.

Looks like adding the path to the folder for the bmp file does not always work for me. If I restart acad then the bmp files are found and all is well. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.