symoin Posted June 22, 2010 Share Posted June 22, 2010 Hai, I have lots of text parallet to polylines, I have to scale them to reduce the size then I have to move the text towards the polyline to reduce the gap between the polylines and the text. These polylines and text are in different directions. Iam looking for a lisp code. Help is always appreciated. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 22, 2010 Share Posted June 22, 2010 Hi You can try this one; (defun c:gap (/ scalefactor input ent xcar) (setq scalefactor(getreal(strcat "\nSpecify scale factor:"))) (setq input scalefactor) (setq ent (car (entsel "\nSelect text: "))) (setq xcar(cdr (assoc 10 (entget ent)))) (command "_scale" ent "" xcar input "") (princ "CadTutor Forum") (princ)) Regards Tharwat Quote Link to comment Share on other sites More sharing options...
symoin Posted June 22, 2010 Author Share Posted June 22, 2010 Thanks Tharwat313, when I copied the lisp into autocad 2009 or when i copied the content into notepad and saved as lisp and apploaded it in autocad 2009 it shows an error messege. (LOAD "d:/moin/gap.lsp") ; error: bad argument type: numberp: nil can you fix this. Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 22, 2010 Share Posted June 22, 2010 Hi Do not worry here is the lisp file attached below. regards, Tharwat gap.LSP Quote Link to comment Share on other sites More sharing options...
asos2000 Posted June 22, 2010 Share Posted June 22, 2010 What is usage of these 2 lines? (setq scalefactor(getreal(strcat "\nSpecify scale factor:"))) (setq input scalefactor) Shouldnt be (setq input (getreal(strcat "\nSpecify scale factor:"))) What is usage of strcat? (setq input (getreal "\nSpecify scale factor:")) or you want to convert real to string (setq input (rtos (getreal "\nSpecify scale factor:"))) Regards Quote Link to comment Share on other sites More sharing options...
symoin Posted June 22, 2010 Author Share Posted June 22, 2010 asos2000 can you fix this i have absolutely no coding knowledge. iam requesting the users for the codes. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 22, 2010 Share Posted June 22, 2010 What is usage of these 2 lines? (setq scalefactor(getreal(strcat "\nSpecify scale factor:"))) (setq input scalefactor) Shouldnt be (setq input (getreal(strcat "\nSpecify scale factor:"))) What is usage of strcat? (setq input (getreal "\nSpecify scale factor:")) or you want to convert real to string (setq input (rtos (getreal "\nSpecify scale factor:"))) Regards I used the 'strcat' because I wanted to add the entered value by the user and I changed my mind due to personal reasons. So that does not affect on the performance of the program Mr asoooooooooos Tharwat Quote Link to comment Share on other sites More sharing options...
symoin Posted June 22, 2010 Author Share Posted June 22, 2010 Hai all, If you could look GT_TXTSLIDE at this link http://www.4d-technologies.com/geotools/manual/text_tools.htm. My requirement is exactly the same as this. can you code something like this. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 22, 2010 Share Posted June 22, 2010 Hai all, If you could look GT_TXTSLIDE at this link http://www.4d-technologies.com/geotools/manual/text_tools.htm. My requirement is exactly the same as this. can you code something like this. most of these commands are included with Autocad express menu, so try to use them , and you will be in no need for any codes except for special routines. Regards Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 Hai all, If you could look GT_TXTSLIDE at this link http://www.4d-technologies.com/geotools/manual/text_tools.htm. My requirement is exactly the same as this. can you code something like this. Why not use what they provide? It's actually really easy to code. Just select the text/mtext, define a rotation and distance, then use the polar command to define and place a new insertionpoint for the text/mtext. eg. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 22, 2010 Share Posted June 22, 2010 I used the 'strcat' because I wanted to add the entered value by the user and I changed my mind due to personal reasons. So that does not affect on the performance of the program Mr asoooooooooos Tharwat That makes no sense. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted June 22, 2010 Share Posted June 22, 2010 That makes no sense. Just imagine this if they decide to open the archive. Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 Just imagine this if they decide to open the archive. :lol: Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 That makes no sense. That's just horrible. Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted June 22, 2010 Share Posted June 22, 2010 :ouch: That's just horrible. Ouch! The truth can hurt. Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 :ouch:Ouch! The truth can hurt. I just couldn't help myself. 'personal reasons' Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 22, 2010 Share Posted June 22, 2010 Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 Not you, what you were responding to. I forgot the you can't quote nested posts. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 22, 2010 Share Posted June 22, 2010 Hi experts the truth is that I made the sense of communications between all memers of this esteemed Forum within a quick reply to a member. And that's so precious ..... isn't? Hot regards, Tharwat Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 22, 2010 Share Posted June 22, 2010 the truth is that I made the sense of communications between all memers of this esteemed Forum within a quick reply to a member. And that's so precious ..... isn't? Is it not better to take a moment and provide a correct response? Rather than post erroneous quickly? 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.