peccy Posted June 27, 2019 Share Posted June 27, 2019 Hi I have been given a 2D line drawing with over 200 layers that I need to check. What I need to check is that the lines are on the correct layers. Is there a way of plotting it with the lines tagged with their layers? I'd like to be able to check a hard copy of this drawing if at all possible. Thanks in advance Quote Link to comment Share on other sites More sharing options...
Organic Posted June 27, 2019 Share Posted June 27, 2019 I'm not sure for a hard copy although you could easily walk through the layers in a DWG file using the 'laywalk' command though. I find this is a good tool for reviewing a drawing that I am unfamiliar with. Quote Link to comment Share on other sites More sharing options...
peccy Posted June 27, 2019 Author Share Posted June 27, 2019 The drawing is of a lattice tower and the difficulty with laywalk is that you can't see the rest of the drawing as you select each layer and we need to see each line in relation to the others so as know it's the correct one. At the moment I'm creating a multileader and adding a field to the text box but it's a long, laborious job and I was hoping to automate it in someway. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 30, 2019 Share Posted June 30, 2019 This is quick and dirty, make sure your text style is non annotative and has text height set to zero. Just change the text height in code 2.5 to what you want. (defun labeline ( / lay stpt endpt ang dist pt oldang oldangdir old angbase) (setq oldang (getvar 'aunits)) (setvar 'aunits 3) (setq oldangdir (getvar 'angdir)) (setvar 'angdir 0) (setq oldangbase (getvar 'angbase)) (setvar 'angbase 0.0) (setq ss (ssget "x" (list (cons 0 "line")))) (repeat (setq x (sslength ss)) (setq obj (entget (ssname ss (setq x (- x 1))))) (setq stpt (cdr (assoc 10 obj))) (setq endpt (cdr (assoc 11 obj))) (setq lay (cdr (assoc 8 obj))) (setq ang (angle stpt endpt)) (setq dist (/ (distance stpt endpt)2.0)) (setq pt (polar stpt ang dist)) (command "text" pt 2.5 ang lay) ) (setvar 'aunits oldang) (setvar 'angdir oldangdir) (setvar 'angbase oldangbase) (princ) ) (labeline) Quote Link to comment Share on other sites More sharing options...
peccy Posted July 1, 2019 Author Share Posted July 1, 2019 Thanks BigAl, but I'm having trouble with it loading (assuming it's coding for a lisp file). When I go to load it it says unable to load. I've never done anything with lisp files before so am really wandering around in the dark here Quote Link to comment Share on other sites More sharing options...
derek2032 Posted July 1, 2019 Share Posted July 1, 2019 Peccy, BIGALs routine works. Apologies if any of these instructions are obvious but here goes. Make sure you have grabbed all the text. From the very top bit (defun labeline ( / lay . . . . To the bottom line . . . . . (labeline) Paste it into Notepad - other plain text editors are available. ;0) Give it a name for example "BigALs-linelabel.lsp" Then load this file with AutoCAD "Appload" command. Then at AutoCAD Command Line Enter: labeline All your LINES get a bit of text on the end aligned to the angle of the line. Hope it helps. Quote Link to comment Share on other sites More sharing options...
peccy Posted July 2, 2019 Author Share Posted July 2, 2019 Argh! I must be doing something wrong then. When I go to load the lsp file the attached is a shot of what I'm seeing telling me it's unable to load the file. Is it me or is it the software I've got?Thanks folks for your help so far Quote Link to comment Share on other sites More sharing options...
tombu Posted July 2, 2019 Share Posted July 2, 2019 Have you tried entering (load "BigALs-linelabel") at the command line? It's setup to run as soon as it loads. Quote Link to comment Share on other sites More sharing options...
peccy Posted July 2, 2019 Author Share Posted July 2, 2019 I tried it, it hasn't worked. I've got the .lsp file saved in the same folder as the .dwg (just in case) and that's not made a difference. It was a .dxf but now is a .dwg, no difference. What on earth am I doing wrong?!? Quote Link to comment Share on other sites More sharing options...
CyberAngel Posted July 2, 2019 Share Posted July 2, 2019 It looks like the LSP file is not in a location where AutoCAD expects it to be. Go to Options|Files and look at the folders under Support File Search Path or Working Support File Search Path. Your code file should be in one of those folders, such as "support." Put a copy there and try loading the function again. Quote Link to comment Share on other sites More sharing options...
tombu Posted July 2, 2019 Share Posted July 2, 2019 4 hours ago, peccy said: I tried it, it hasn't worked. I've got the .lsp file saved in the same folder as the .dwg (just in case) and that's not made a difference. It was a .dxf but now is a .dwg, no difference. What on earth am I doing wrong?!? That will not work in recent versions of AutoCAD. Put it in a folder in Options → Files tab → 'Support File Search Path' that's also in 'Trusted Locations'. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 3, 2019 Share Posted July 3, 2019 I set it up so when loaded would run straight away that's per last line (labeline) If you open explorer find the lisp file that you saved via notepad you can drag and drop onto the open Autocad dwg a message will appear about trusted location just click Ok and it should then run. I just copied from here to notepad, saved and dragged to a dwg and it worked. BigALs-linelabel.lsp Quote Link to comment Share on other sites More sharing options...
peccy Posted July 3, 2019 Author Share Posted July 3, 2019 I think I may have figured out why it's not working. Our workstations are locked down so we cannot do much without administrator rights. I cannot save a file to the trusted locations listed and if I try to add a location I get an error message stating "The directory specified for log files must exist and have read/write permission. The value previously saved for the log files directory will be used." Sadly, I think it's a good old fashioned case of computer says no Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 4, 2019 Share Posted July 4, 2019 Try drag and drop , then chase IT to give permission to add files to say a network directory, they can open lisps and look for paranoid words like delete, file. Lisp is not a hard language to read. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.