Author Topic: Clear text file contents  (Read 2087 times)

0 Members and 1 Guest are viewing this topic.

Dommy2Hotty

  • Swamp Rat
  • Posts: 1128
Clear text file contents
« on: July 12, 2005, 10:52:51 AM »
Building off the the LoadSupportPaths Lisp
Code: [Select]
(vl-load-com)
(setq files (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(setq paths (vla-get-supportpath files))
(setq f (open "A:\\StandardPaths.txt" "w"))
(write-line paths f)
(close f)
(setq files (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(setq f (open "A:\\StandardPaths.txt" "r"))
(setq paths (read-line f))
(close f)
(setq paths (strcat "C:\\Program Files\\ASE\\Building_Maintanence_Program\\MacNeal\\Config" ";" "C:\\Program Files\\ASE\\Building_Maintanence_Program\\MacNeal\\Scripts" ";" paths))
(vla-put-supportpath files paths)


Now I want to delete all information from the text file...how would I go about this?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Clear text file contents
« Reply #1 on: July 12, 2005, 11:05:39 AM »
Open the file for writing, just don't write to it.
Code: [Select]

(setq file "C:\\Temp\\__dwgs.txt")
(setq file_open (open file "w"))
(close file_open)
TheSwamp.org  (serving the CAD community since 2003)

Dommy2Hotty

  • Swamp Rat
  • Posts: 1128
Clear text file contents
« Reply #2 on: July 12, 2005, 11:22:12 AM »
Ahhh...thank you master!  Sometimes things can be so simple...

CADwoman

  • Guest
Re: Clear text file contents
« Reply #3 on: November 10, 2005, 11:35:48 AM »
Hi, I'm trying to change all the users support paths when they start AutoCAD. What is your recommendation? Thanks

Open the file for writing, just don't write to it.
Code: [Select]
(setq file "C:\\Temp\\__dwgs.txt")
(setq file_open (open file "w"))
(close file_open)

Bob Wahr

  • Guest
Re: Clear text file contents
« Reply #4 on: November 10, 2005, 12:05:32 PM »
Starting a new thread.  One that deals with the issue at hand.