The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Hurricane for AutoCAD
 General Discussion
 Import layers from txt file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
bse1963 Posted - December 04 2006 : 09:35:29 AM
Hi

I have txt files with Layer Names,Color, Linetype, and a Description.

How do i create a script to read the containts of the txt file to make the layers?

what is the fromat the txt file needs in order to be read?

thanks
6   L A T E S T    R E P L I E S    (Newest First)
n/a Posted - December 04 2006 : 3:26:45 PM
You're welcome. Glad to help when I can.
bse1963 Posted - December 04 2006 : 3:13:09 PM
Thanks, it works great.
n/a Posted - December 04 2006 : 2:21:25 PM
I took the time to figure out why the routine was skipping the first line of the LYR file. This version should read the top line correctly without having to duplicate it. (I was able to shorten the routine some, also. I was kind of redundant with the previous versions and that was actually causing the line skip.)

Download Attachment: Mlayer3.zip
1.19 KB
n/a Posted - December 04 2006 : 1:56:23 PM
I didn't know how to get the description into the drawing (see my first post). However:

I did some research. Give these a try. Note: I think the option that I found uses Vlisp, Active X, or something. I'm not even sure which, or if they are the same thing or something different. Anyway: It seemed to work on my system, but I think you may have to have a version of AutoCAD newer than R14 for it to work for you. Again, make sure to back up your drawing files.

Also, I found that after the rework, anyway, that the first line of the LYR file was not being added/created in the drawing. The quickest way to solve the problem seemed to be to add a "dummy" line prior to the actual line that I needed. I simply repeated the first set of layers, ltypes, etc., so it skipped the first line and started with the duplicate second line.

Download Attachment: Mlayer2.zip
1.22 KB
bse1963 Posted - December 04 2006 : 12:59:21 PM
thanks,

that that lisp works well, except i have a "column" with a "discription".

Autocad, in the -layer command has no way to make a discription, do you know of any way to add the discription?

see attached file

Download Attachment: mlayers.LYR.txt
6.65 KB
n/a Posted - December 04 2006 : 11:20:58 AM
I've attached a zip file which contains a LSP file and a LYR file which is similar to what you want, I think. The LYR file has to be in the format shown for the LSP file to work correctly. It is also required by the LSP file to be in the root of the C drive, although the LSP can be altered for another location. The LYR file, will have to be altered, of course, for your specific Layer names, colors, and linetypes. I don't know how to get the descriptions into the drawings, tho.

Before you start, back up your drawing files someplace safe in case the results are not what you expect.

Then, in order to use the LSP file, locate it in the AutoCAD search path. Create and run a two line script file as below:

(load "Mlayer")
Mlayer


Hope this helps.

Download Attachment: Mlayer.zip
1.11 KB

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.14 seconds. Snitz Forums 2000