mxpxh2o Posted June 4, 2010 Share Posted June 4, 2010 Hi, i've been searching for a while not but cannot find one. I need to change both the linetypes and colours of lots of blocks to BYLAYER. I have found a lisp routine to do the colour here http://www.cadcorner.ca/lisp.php but i am still unable to find one to do linetype. I have no idea how to write lisps but am trying to learn atm. Any help would be great. Thanks. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 4, 2010 Share Posted June 4, 2010 Seems to me that the FixBlock.lsp routine from that site is changing both color and linetype to ByBlock; it also move nested entities in layer 0 (just checked the code). Regards, Quote Link to comment Share on other sites More sharing options...
mxpxh2o Posted June 4, 2010 Author Share Posted June 4, 2010 I actually saw that one but it didnt even occur to me to use that one first then the colour one until you posted. Thanks. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 4, 2010 Share Posted June 4, 2010 ... use that one first then the colour one ... You don't need to use other routine to change the color - the above FixBlock tool is doing all-in-one. Regards, Quote Link to comment Share on other sites More sharing options...
mxpxh2o Posted June 4, 2010 Author Share Posted June 4, 2010 Yes but i need both the colour and linetype to be BYLAYER. This routine makes the colour BYBLOCK. But the other one I have changes the colour BYLAYER so if I use that afterwards the colour and linetype will be BYLAYER. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 4, 2010 Share Posted June 4, 2010 OK, I see now; may change that code as per below example to fit your needs: [color=red](cons 6 "BYBLOCK")[/color] replace with [color=green](cons 6 "ByLayer")[/color] [color=red](cons 62 0)[/color] replace with [color=green](cons 62 256)[/color] Regards, Quote Link to comment Share on other sites More sharing options...
mxpxh2o Posted June 4, 2010 Author Share Posted June 4, 2010 Thank you, This worked great. Well with only one problem, the lisp willnot respond to the fixblock command once loaded. I have to go in and load it every time. Is there a way to map a button to a lisp routine? Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 4, 2010 Share Posted June 4, 2010 This is because it is defined as function, not as command – just add code below at the end of the file: (defun c:FxB() ;define FxB command (d_FixBlock) (princ) ) This will define the FxB command - add it to your toolbar as any built-in command. Add the file to Start-up suite to have it automatically loaded in each drawing. Regards, Quote Link to comment Share on other sites More sharing options...
mxpxh2o Posted June 4, 2010 Author Share Posted June 4, 2010 Thank you very much. This lsp does everything i want it. My Life = Easier. Im trying to learn how to write lisps at the minute but im finding it very difficult. Thanks, Sean. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 4, 2010 Share Posted June 4, 2010 You're entirely welcome! Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 4, 2010 Share Posted June 4, 2010 By the way, you may also want to avoid the routine to be executed at file loading; to do so just place in comment the function call line: [color=DarkGreen];[/color](fb) Regards, Quote Link to comment Share on other sites More sharing options...
VVA Posted June 7, 2010 Share Posted June 7, 2010 Hi, i've been searching for a while not but cannot find one. I need to change both the linetypes and colours of lots of blocks to BYLAYER. Look here Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 7, 2010 Share Posted June 7, 2010 For those with newer versions of AutoCAD. 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.