Jump to content

Recommended Posts

Posted

Hi

is it possible to change all Layer's LWeights in a drawing to a specific LWeight ?

 

Thanks

 

Michaels

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

  • Michaels

    14

  • alanjt

    11

  • Lee Mac

    11

  • rkmcswain

    6

Popular Days

Top Posters In This Topic

Posted
(vlax-for x (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
 (vla-put-lineweight x lw)
)

Posted

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

Posted

yahaa

I did use before, but the same message.

Posted

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

Posted
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

Posted
yahaa

I 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?

Posted

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.

Posted
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.

Posted
I do not know what do you mean by Language

 

What Language AutoCAD?

(English, Spanish, French, etc.)

Posted
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

Posted
What Language AutoCAD?

(English, Spanish, French, etc.)

 

I am sorry for misunderstanding. I am using the English version.

Thanks

Posted
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.

Posted

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 :cry:

Posted
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.

Posted
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 :cry:

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

Posted
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.

Posted

So can we go back to the main issue Please Gents. ??

 

Thanks

 

Michaels

Posted
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".

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...