sala Posted July 13, 2016 Share Posted July 13, 2016 (edited) Hi guys I have to change a lot of electrical sketches to plot them in pdf. The words in those sketches have to be searchable by PDF. So the fact is that I have to change the Width factor to 1. I'm already using a lisp for changing the width factor in different block attributes. Now i'm trying to find a lisp for changing font to Tahoma and the width factor for different styles to 1.0 , cuz it takes a lot of work to plot thousand and thousands of sketches to pdf. ow yeah btw i'm a newbie. I actually have used autocad for a week now. so don't make it to difficult for me. Greetings from Belgium Edited July 13, 2016 by sala more information Quote Link to comment Share on other sites More sharing options...
Dadgad Posted July 13, 2016 Share Posted July 13, 2016 Welcome to CADTutor sala. This link should get you headed in a positive and productive direction. http://www.ellenfinkelstein.com/acadblog/use-a-standards-file-to-bring-an-autocad-drawing-into-line/ Quote Link to comment Share on other sites More sharing options...
sala Posted July 13, 2016 Author Share Posted July 13, 2016 Thanks dadgad! I haven't tried it yet, but it looks like they are replacing the styles? That's not what I want. I'm actually just looking for something to change only the Width factor and the font to Tahoma for all the text styles at once if that is also possible without changing anything else about that text style (there are per file like 3 to 12 different text styles) . I have here right now 3000 electrical sketches waiting for me to be converted to pdf and there are like thousands more. so I tried first just the command 'style' and changing the fonts to Tahoma and the Width for every text style, but after a while I figured out that not everything was searchable because some texts where in block attributes. The last problem is luckily fixed now by using a lisp file. Now I'm only looking for a solution for this problem and i'm good to go! Quote Link to comment Share on other sites More sharing options...
RobDraw Posted July 13, 2016 Share Posted July 13, 2016 There is no way that this is not going to be difficult for you since you are new. It will also be time consuming. First thing I would do is to create a file with all of the text styles set up properly. Save that file somewhere handy. Next I would look for a LISP to replace text styles. Yes, replace them. I believe that it will be easier than trying to alter the existing ones. You might be able to replace with the same style name but you might need to change the names slightly for the routine to work. You will have to determine that. This could be also done by inserting the drawings into the file you created to hold the altered style definitions. Quote Link to comment Share on other sites More sharing options...
MillerMG Posted July 13, 2016 Share Posted July 13, 2016 why can't you set one up and do a match properties? Quote Link to comment Share on other sites More sharing options...
RobDraw Posted July 13, 2016 Share Posted July 13, 2016 This is why. I have here right now 3000 electrical sketches waiting for me to be converted to pdf and there are like thousands more. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 14, 2016 Share Posted July 14, 2016 This will change all some ttf works others dont need perhaps correct name which is slightly different to the known name will try to find it for Tahoma (vlax-for TEXTS (vla-get-TextstyleS (vla-get-activedocument (vlax-get-acad-object))) (vla-put-Fontfile TEXTS "Arial.ttf") ) Quote Link to comment Share on other sites More sharing options...
sala Posted July 14, 2016 Author Share Posted July 14, 2016 Thanks guys! I will take a look at your ideas. Your code looks nice, Bigal. If I only can understand what it says. It also only works for text only, not mtext right? Quote Link to comment Share on other sites More sharing options...
sala Posted July 14, 2016 Author Share Posted July 14, 2016 I think I fount it i'm using the code like this (vl-load-com) (defun C:sala () (vlax-for x (vla-get-TextStyles (vla-get-activedocument (vlax-get-acad-object)) ) (princ) (vla-setfont x "Tahoma" :vlax-False :vlax-False 0 32) ) ) it just says always "nil" at the end? what is the meaning of that? Quote Link to comment Share on other sites More sharing options...
MillerMG Posted July 14, 2016 Share Posted July 14, 2016 This is why. Ten four. Why can't you isolate those and select a bunch at once? Thousands or not, if you isolate the layers it shouldn't take long at all. When we have scales change on viewports I have to go in and change all of the text and leader sizes. its not thousands but several hundreds worth. Quote Link to comment Share on other sites More sharing options...
RobDraw Posted July 14, 2016 Share Posted July 14, 2016 The OP is looking for an easy button and does not want to have to select multiple entities in multiple files. Quote Link to comment Share on other sites More sharing options...
MillerMG Posted July 14, 2016 Share Posted July 14, 2016 Ahh I see. Thanks RobDraw Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 15, 2016 Share Posted July 15, 2016 Went and found the info for anyone else. SetFont Typeface, Bold, Italic, CharSet, PitchAndFamily Quote Link to comment Share on other sites More sharing options...
sala Posted July 15, 2016 Author Share Posted July 15, 2016 Thanks the Code works amazing is there also a way to add something to it that the width changes to 1.0? I mean all text like in blocks and without blocks and Mtext too? I'm almost the autocad specialist at my job now and i'm only using this for almost 2 weeks. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 16, 2016 Share Posted July 16, 2016 Do a bit of searching there should be an answer to the blocks part. With Mtext you have to go inside the Mtext and change the text, it can be done though just a bit more complex again search. Quote Link to comment Share on other sites More sharing options...
sala Posted July 18, 2016 Author Share Posted July 18, 2016 (edited) Thanks! I have found what I was looking for now i'm trying to get to the next step, opening a file and it modifies itself by using an autolisp. It works fine with commands, but when I try to add a lisp command in the file by using (load 'nameofthefile') This is in acad2015.lsp. I also tried the command "_appload" and just "command". it does nothing? I guess I have to tell the autolisp also where it can find the lisp? I have it in a flash drive so i tried "F:\nameoffile". it didn't work either Edited July 18, 2016 by sala Quote Link to comment Share on other sites More sharing options...
sala Posted July 18, 2016 Author Share Posted July 18, 2016 PROBLEM SOLVED! just copied the code into the lisp file Quote Link to comment Share on other sites More sharing options...
MillerMG Posted July 18, 2016 Share Posted July 18, 2016 Sala, Great job figuring out the solution. It's always cool to see new members get what they were looking for. Also, finishing a thread allows someone that may have the same issue to see how to solve it. Bravo Quote Link to comment Share on other sites More sharing options...
sala Posted July 19, 2016 Author Share Posted July 19, 2016 Thanks! 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.