Go Back   Cadalyst Discussion Forums > Forums > CAD Questions
FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Notices

CAD Questions Need Help? Moderator Paul Aubin and the CAD community tackle all your CAD-related questions.

 
 
Thread Tools Display Modes
  #1  
Old 11-07-2007, 11:10 AM
startrek's Avatar
startrek startrek is offline
Senior Member
 
Join Date: May 2004
Location: Seattle
Posts: 799
Send a message via Skype™ to startrek
Default How to Export LINETYPES in the drawing to LIN file??

Hi everyone,
Does anybody know if it is possible to Export all LINETYPES in the drawing to LIN file?? The only way I know is - by using DESIGN center, by dragging needed linetypes into different drawings. BUT is it possible to create LIN file???
__________________
Len Nemirovsky http://home.pacifier.com/~nemi
Whenever ideas are shared, the result is
always greater than sum of the parts.
  #2  
Old 11-07-2007, 12:08 PM
jonwilli jonwilli is offline
Senior Member
 
Join Date: Dec 2004
Location: Colorado
Posts: 266
Default

I got a lisp (free from internet somewhere) where you could export a linetype. I then manually opened both linetype files and copy / paste.
__________________
The world is not as strange as you think, but stranger than you CAN think! ~ R.A.W.
  #3  
Old 11-07-2007, 12:31 PM
startrek's Avatar
startrek startrek is offline
Senior Member
 
Join Date: May 2004
Location: Seattle
Posts: 799
Send a message via Skype™ to startrek
Default

Quote:
Originally Posted by jonwilli
I got a lisp (free from internet somewhere) where you could export a linetype. I then manually opened both linetype files and copy / paste.
Can i take a look at it ????
__________________
Len Nemirovsky http://home.pacifier.com/~nemi
Whenever ideas are shared, the result is
always greater than sum of the parts.
  #4  
Old 11-07-2007, 05:07 PM
CarlB CarlB is offline
Senior Member
 
Join Date: Jun 2004
Posts: 667
Default

Maybe this:

http://www.turvill.com/t2/free_stuff/index.htm

TO-LIN.LSP

"Extracts definition data for any unknown LineType (simple or complex) from any R14 or A2K drawing & writes to NEWLT.LIN (ASCII) file. Also, see NEW-LIN.LSP, above."
  #5  
Old 11-08-2007, 07:23 AM
Cap'n Mac's Avatar
Cap'n Mac Cap'n Mac is offline
Senior Member
 
Join Date: May 2002
Location: Bryan, Texas
Posts: 2,195
Default

Well, if "we" can write an ascii file, we ought to be able to Apend to the existing acad.lin file with (write-line).

Hmm, trickier part will be in the making a backup for the Acad.lin file . . .

This is something I've been noodling on, on a "Found new linetype(s)! Care to add them?" sort of function.
  #6  
Old 11-08-2007, 12:49 PM
jonwilli jonwilli is offline
Senior Member
 
Join Date: Dec 2004
Location: Colorado
Posts: 266
Default

Just tested in 2008 and works:

; TIP1076.LSP: LLTYPES.LSP Extract Linetypes (c)1995, Greg Oliver

(defun dxf (CODE ELIST)
(cdr (assoc CODE ELIST))
)

(defun C:LLTYPES (/ LT WISH LTL LTS LTSM NDLI N LTN LTDES LTDEF DL STR LTFW LTFR FLAG)
(setq LT (tblnext "LTYPE" T)) ;first ltype
(initget 1 "Yes No") ;Establish keywords, no null
(setq WISH (getkword "\nWrite Linetype definitions to a file (Y/N) ? "))
(if (= WISH "Yes")
(progn
(setq LTFW (open "ltypes.lin" "a")) ;linetype file (for writing)
)
)
(while LT
(setq N 0
LTN (dxf 2 LT) ;ltype name
LTDES (dxf 3 LT) ;ltype description
NDLI (dxf 73 LT) ;number of dashed items
)
(if (> NDLI 0)
(progn
(setq ltl (member (assoc 49 lt) lt) ;list of "49" groups - dashed items
LTS (strcat "*" ltn ",") ;linetype string - eg. "*DASHED,"
LTSM (strcat "`*" ltn "`,*") ;string used in "wcmatch" - special chars. escaped
LTDEF (strcat "A") ;linetype definition + alignment code
DL 0
)
(while (setq DL (cdr (nth N LTL)))
(setq LTDEF (strcat LTDEF "," (rtos DL))
N (1+ N)
)
)
(if (= WISH "Yes")
(progn
(setq FLAG "write")
(setq LTFR (open "ltypes.lin" "r")) ;linetype file (for reading)
(while (/= (setq STR (read-line LTFR)) nil)
(if (wcmatch STR LTSM) ;check if linetype is already defined in file
(progn
(princ (strcat "\nLinetype " ltn " is already defined in ltypes.lin"))
(setq FLAG "nowrite")
)
)
)
(close LTFR)
(if (= FLAG "write") ;write linetype information to a file ?
(progn
(princ (strcat "\nWriting " ltn " definition to ltypes.lin"))
(princ (strcat LTS LTDES "\n") LTFW) ;linetype name & description
(princ (strcat LTDEF "\n") LTFW) ;definition
)
)
)
(progn
(princ (strcat LTS LTDES "\n"))
(princ (strcat LTDEF "\n"))
)
)
)
)
(setq LT (tblnext "LTYPE"))
)
(if LTFW (close LTFW)) ;if linetype file was opened, close it.
(princ)
)
(c:lltypes); end lltypes.lsp
__________________
The world is not as strange as you think, but stranger than you CAN think! ~ R.A.W.
  #7  
Old 11-08-2007, 02:17 PM
startrek's Avatar
startrek startrek is offline
Senior Member
 
Join Date: May 2004
Location: Seattle
Posts: 799
Send a message via Skype™ to startrek
Default

Thanks To All -
__________________
Len Nemirovsky http://home.pacifier.com/~nemi
Whenever ideas are shared, the result is
always greater than sum of the parts.
  #8  
Old 11-09-2007, 05:07 AM
wizman's Avatar
wizman wizman is offline
Senior Member
 
Join Date: Sep 2004
Location: Abu Dhabi / Philippines
Posts: 276
Default

Quote:
Originally Posted by jonwilli
Just tested in 2008 and works:

; TIP1076.LSP: LLTYPES.LSP Extract Linetypes (c)1995, Greg Oliver

(defun dxf (CODE ELIST)
(cdr (assoc CODE ELIST))
)
.....................
(princ)
)
(c:lltypes); end lltypes.lsp

I SEARCHED IN MY COMPUTER FOR *.LIN BUT NO LTYPES.LIN, WHERE IS THIS LSP GENERATING/WRITING THE LINETYPES?
  #9  
Old 11-09-2007, 12:48 PM
jonwilli jonwilli is offline
Senior Member
 
Join Date: Dec 2004
Location: Colorado
Posts: 266
Default

It is in the base folder of the drawing file location. For example, if you were working off of the local network drive, it would be something like this:
P:/0604/dwg
__________________
The world is not as strange as you think, but stranger than you CAN think! ~ R.A.W.
  #10  
Old 11-09-2007, 10:01 PM
wizman's Avatar
wizman wizman is offline
Senior Member
 
Join Date: Sep 2004
Location: Abu Dhabi / Philippines
Posts: 276
Default

ok, i will have a look in the server after the weekend. Thanks jon.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:20 PM.





Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.