Michaels Posted July 20, 2010 Posted July 20, 2010 Hi is it possible to change all Layer's LWeights in a drawing to a specific LWeight ? Thanks Michaels Quote
alanjt Posted July 20, 2010 Posted July 20, 2010 (vlax-for x (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (vla-put-lineweight x lw) ) Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 Hi Actually I am receiving the following error when I use the code; vlax-get-acad-object the error message. ; error: no function definition: VLAX-GET-ACAD-OBJECT Regards Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 yahaa I did use before, but the same message. Quote
Lee Mac Posted July 20, 2010 Posted July 20, 2010 Hey guys, FYI, I added an extra post to this thread to help with repetition http://www.cadtutor.net/forum/showthread.php?1390-How-to-use-the-LISP-routines-in-this-archive Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 Hey guys, FYI, I added an extra post to this thread to help with repetition http://www.cadtutor.net/forum/showthread.php?1390-How-to-use-the-LISP-routines-in-this-archive yes as I have mentioned before, I did use to actually added the (vl-load-com) at the top of the codes. Thanks Michaels Quote
rkmcswain Posted July 20, 2010 Posted July 20, 2010 yahaaI did use before, but the same message. So you are using all of this code and still get the error message? (vl-load-com) (vlax-for x (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (vla-put-lineweight x lw) ) If so, what version and language of AutoCAD are you using? Quote
Lee Mac Posted July 20, 2010 Posted July 20, 2010 I found when I first installed a new CAD, you had to manually type '(vl-load-com)' at the command line to load the VL functions, then subsequently put a call in your ACADDOC.lsp - but maybe that's just me. Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 So you are using all of this code and still get the error message? (vl-load-com) (vlax-for x (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (vla-put-lineweight x lw) ) If so, what version and language of AutoCAD are you using? Exactly . I am using Autocad 2010, and I do not know what do you mean by Language in here, But I am dealing with Lisp all the time , no VBA is used at all . Thanks. Quote
rkmcswain Posted July 20, 2010 Posted July 20, 2010 I do not know what do you mean by Language What Language AutoCAD? (English, Spanish, French, etc.) Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 I found when I first installed a new CAD, you had to manually type '(vl-load-com)' at the command line to load the VL functions, then subsequently put a call in your ACADDOC.lsp - but maybe that's just me. I did not get your point well, and I still affraid to enter the ACADDOC.lsp file, due to unablility to solve any problem may take a place later on. and by the way, Where should I insert that function (VL-LOAD-COM) in the ACADDOC ? Thank Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 What Language AutoCAD?(English, Spanish, French, etc.) I am sorry for misunderstanding. I am using the English version. Thanks Quote
rkmcswain Posted July 20, 2010 Posted July 20, 2010 I found when I first installed a new CAD, you had to manually type '(vl-load-com)' at the command line to load the VL functions, then subsequently put a call in your ACADDOC.lsp - but maybe that's just me. FWIW - We've never had to load in manually. Loading it from a file works OK. Quote
eldon Posted July 20, 2010 Posted July 20, 2010 I know that this thread was posted in the Customization section, but wouldn't the whole process be much simpler with the built in Layer Properties Manager. Folk are being spoilt with all this Lisp and are forgetting the basic AutoCAD Quote
Lee Mac Posted July 20, 2010 Posted July 20, 2010 I did not get your point well, and I still affraid to enter the ACADDOC.lsp file, due to unablility to solve any problem may take a place later on.and by the way, Where should I insert that function (VL-LOAD-COM) in the ACADDOC ? Thank I meant just typing (vl-load-com) at the AutoCAD Command line and pressing enter, then trying the function. As for the ACADDOC.lsp, anywhere. Probably best at the top. Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 I know that this thread was posted in the Customization section, but wouldn't the whole process be much simpler with the built in Layer Properties Manager. Folk are being spoilt with all this Lisp and are forgetting the basic AutoCAD The main issue of the matter not to know how to make it manually in Autocad, and when you getting forward in programming you are not gonnal use or depend on Autocad manual tools. Thanks Quote
rkmcswain Posted July 20, 2010 Posted July 20, 2010 I know that this thread was posted in the Customization section, but wouldn't the whole process be much simpler with the built in Layer Properties Manager. Folk are being spoilt with all this Lisp and are forgetting the basic AutoCAD... Sure for a single drawing, but using the GUI is not possible if you are writing a script to process 10, 100, 1000, or more drawings. And if this is something you do a dozen times a day (because you are working on drawings from others for example), then clicking a toolbar button with this code behind it is many, many times quicker than messing with a dialog box. Quote
Michaels Posted July 20, 2010 Author Posted July 20, 2010 So can we go back to the main issue Please Gents. ?? Thanks Michaels Quote
rkmcswain Posted July 20, 2010 Posted July 20, 2010 As for the ACADDOC.lsp, anywhere. Probably best at the top. It doesn't hurt anything to load it multiple times, but (vl-load-com) only *has* to be loaded once per session, so it could go at the top of "acad.lsp". Quote
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.