list file creation
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
list file creation

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Tomwin
Guest





Posted: Thu Dec 30, 2004 10:00 pm    Post subject: list file creation Reply with quote

We have a lisp routine that we use for our dimensioning program. When we run it, it creates a file called LST.FL in the same folder of the drawing that we are working on. Is there some sort of simple command line we could add to the lisp file to specify where LST.FL is created?

The lisp routine has us pick 2 points and a location for the dimension that is placed in the drawing using attdef. When we pick the points it creates the LST.FL file with the data and uses the data from it to populate the attdef fields.

I can't post the actual code from our lisp file, hopefully someone knows an easy way to specify where to create files to be used in the lisp though.

Back to top
Eric Schneider
Guest





Posted: Thu Dec 30, 2004 10:11 pm    Post subject: Re: list file creation Reply with quote

You could move it:

(vl-file-rename (strcat (getvar "dwgprefix") "LST.FL")
"your_new_fully_qualified_file_name)

"Tomwin" <nospam@address.withheld> wrote in message
news:14467103.1104426031782.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
We have a lisp routine that we use for our dimensioning program. When we
run it, it creates a file called LST.FL in the same folder of the drawing

that we are working on. Is there some sort of simple command line we could
add to the lisp file to specify where LST.FL is created?
Quote:

The lisp routine has us pick 2 points and a location for the dimension
that is placed in the drawing using attdef. When we pick the points it

creates the LST.FL file with the data and uses the data from it to populate
the attdef fields.
Quote:

I can't post the actual code from our lisp file, hopefully someone knows
an easy way to specify where to create files to be used in the lisp though.
Back to top
Paul Turvill
Guest





Posted: Thu Dec 30, 2004 10:13 pm    Post subject: Re: list file creation Reply with quote

All you need to do is to hard-code the path wherever the filename is
specified in the original code. Find the reference to "LST.FL" and change it
to "D:/MyPath/LST.FL" where D:/MyPath/ is the actual path where you want the
file to go.

BTW, what's preventing you from posting the actual code?
___

"Tomwin" <nospam@address.withheld> wrote in message
news:14467103.1104426031782.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
We have a lisp routine that we use for our dimensioning program. When we
run it, it creates a file called LST.FL in the same folder of the drawing
that we are working on. Is there some sort of simple command line we
could add to the lisp file to specify where LST.FL is created?

The lisp routine has us pick 2 points and a location for the dimension
that is placed in the drawing using attdef. When we pick the points it
creates the LST.FL file with the data and uses the data from it to
populate the attdef fields.

I can't post the actual code from our lisp file, hopefully someone knows
an easy way to specify where to create files to be used in the lisp
though.


Back to top
Allen Johnson
Guest





Posted: Thu Dec 30, 2004 10:27 pm    Post subject: Re: list file creation Reply with quote

The system variable "DWGPREFIX" contains the path to the drawing.
Assuming that there is a line like

(setq fname (strcat (getvar "DWGPREFIX") "LST.FL"))

in your program, you can change the line to include a global variable (say
LSTFLPath)
and change the line above to:

(setq fname (strcat LSTFLPath "LST.FL"))

And create another lisp program to prompt for the path

(defun c:LSTPath (/ flag)
(if (not LSTFLPath) (setq LSTFLPath "C:/zzz"))
(while (not flag)
(setq LSTFLPath (getstring (strcat "\nEnter path to store LST.FL ["
LSTFLPath "]: " )))
(Prompt (if (setq flag (vl-file-directory-p lstflpath))"\nFolder Exists"
"\nNo Folder" ))
)
(princ)
)
Back to top
Tomwin
Guest





Posted: Thu Dec 30, 2004 10:30 pm    Post subject: Re: list file creation Reply with quote

the only reference that i can find to LST.FL is when it says (OPEN "LST.FL" "w")

Other than that, I can't find where it is actually being created.

I can't post the code because it's the property of my employer and I don't want to get fired for trying to fix their problem by posting it or information that is property of them... heh
Back to top
Paul Turvill
Guest





Posted: Thu Dec 30, 2004 10:59 pm    Post subject: Re: list file creation Reply with quote

That's the line you need to change. The (open ... "w") function in LISP
creates a new file for writing...and overwrites an old one if it's found.
___

"Tomwin" <nospam@address.withheld> wrote in message
news:13118759.1104427882061.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
the only reference that i can find to LST.FL is when it says (OPEN
"LST.FL" "w")

Other than that, I can't find where it is actually being created.

I can't post the code because it's the property of my employer and I don't
want to get fired for trying to fix their problem by posting it or
information that is property of them... heh
Back to top
MP
Guest





Posted: Thu Dec 30, 2004 11:04 pm    Post subject: Re: list file creation Reply with quote

well, that line is where it's being created.
see the help for Open function
Paul's suggestion was to hard code the path at that point.

"Tomwin" <nospam@address.withheld> wrote in message
news:13118759.1104427882061.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
the only reference that i can find to LST.FL is when it says (OPEN
"LST.FL" "w")

Other than that, I can't find where it is actually being created.

I can't post the code because it's the property of my employer and I don't
want to get fired for trying to fix their problem by posting it or

information that is property of them... heh
Back to top
Tomwin
Guest





Posted: Fri Dec 31, 2004 12:27 am    Post subject: Re: list file creation Reply with quote

Thank you, that fixed it. I tried to path it to C:\TEMP\LST.FL but for some reason it created a file on C:\ called TEMPLST.FL

I changed it to say just C:\LST.FL and it is working fine and creating the file on the root C:\
Back to top
Laurie Comerford
Guest





Posted: Fri Dec 31, 2004 12:53 am    Post subject: Re: list file creation Reply with quote

HI,

When you define a path in lisp you need to use double backslashes, or
forward slashes.

eg C:\\TEMP\\LST.FL or
C:/TEMP/LST.FL

--


Laurie Comerford
CADApps
www.cadapps.com.au

"Tomwin" <nospam@address.withheld> wrote in message
news:14569263.1104434903123.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
Thank you, that fixed it. I tried to path it to C:\TEMP\LST.FL but for
some reason it created a file on C:\ called TEMPLST.FL

I changed it to say just C:\LST.FL and it is working fine and creating the
file on the root C:\
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB