Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
Posts: 308
Registered: ‎10-24-2007
Message 1 of 7 (793 Views)

LISP routine to change Line Width

793 Views, 6 Replies
12-12-2008 02:28 PM
Is there a LISP routine that changes line width, to ByLayer.

I found (vla-put-Thickness (vlax-ename->vla-object ej) acByLayer), which runs; but does not change the line width. What does it do?

I also found (vla-put-Width (vlax-ename->vla-object ej) acByLayer); but it will not run period and I suppose that might be because it is Test Width.

Any help you can give will be appreciative. Thanks.

-Chris
Mentor
Posts: 1,678
Registered: ‎03-14-2004
Message 2 of 7 (793 Views)

Re: LISP routine to change Line Width

12-12-2008 03:18 PM in reply to: hanchris




(setq ej (car (entsel)))



(setq ej-obj (vlax-ename->vla-object ej))



(vla-put-lineweight ej-obj acLnWtByLayer );_ it is {color:#0000ff}acLnWtByLayer{color} not {color:#ff0000}acByLAyer{color}



(setvar 'lwdisplay 1);_ set to see the lineweight











(vla-put-Thickness ej-obj acByLayer);_, which runs; but does not change the line width. What does it do?



;;;Thickness is HIGH, you will see in a: left, rigth, front, back, view, or a any iso view



;;;lineweight is wide







;;;I also found (vla-put-Width (vlax-ename->vla-object ej) acByLayer); but it will not run period and I suppose that might be because it is Test ;;Width. is a LWPOLINE prop.







;;;



;;;Width is not a line property.



;;;To get prop and method for an OBJ use







(vlax-dump-Object ej-obj t)







; IAcadLine: AutoCAD Line Interface



; Property values:



; Angle (RO) = 6.08505



; Application (RO) = #<VLA-OBJECT IAcadApplication 00d73d3c>



; Delta (RO) = (339.007 -68.0628 0.0)



; Document (RO) = #<VLA-OBJECT IAcadDocument 01f15ad0>



; EndPoint = (274.041 48.5839 0.0)



; Handle (RO) = "1FB"



; HasExtensionDictionary (RO) = 0



; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 1145319c>



; Layer = "0"



; Length (RO) = 345.772



; Linetype = "ByLayer"



; LinetypeScale = 1.0



; Lineweight = -1



; Material = "ByLayer"



; Normal = (0.0 0.0 1.0)



; ObjectID (RO) = 2128557592



; ObjectName (RO) = "AcDbLine"



; OwnerID (RO) = 2128592120



; PlotStyleName = "ByLayer"



; StartPoint = (-64.9665 116.647 0.0)



; Thickness = 0.0



; TrueColor = #<VLA-OBJECT IAcadAcCmColor 02040948>



; Visible = -1



; Methods supported:



; ArrayPolar (3)



; ArrayRectangular (6)



; Copy ()



; Delete ()



; GetBoundingBox (2)



; GetExtensionDictionary ()



; GetXData (3)



; Highlight (1)



; IntersectWith (2)



; Mirror (2)



; Mirror3D (3)



; Move (2)



; Offset (1)



; Rotate (2)



; Rotate3D (3)



; ScaleEntity (2)



; SetXData (2)



; TransformBy (1)



; Update ()











_$ Edited by: DEVITG on Dec 12, 2008 8:18 PM
Distinguished Contributor
Posts: 308
Registered: ‎10-24-2007
Message 3 of 7 (793 Views)

Re: LISP routine to change Line Width

12-12-2008 03:32 PM in reply to: hanchris
Thank, thank you.

This has been a lot of help, you have no idea how much I searched Google before I decided to ask the question myself.
Mentor
Posts: 1,678
Registered: ‎03-14-2004
Message 4 of 7 (793 Views)

Re: LISP routine to change Line Width

12-12-2008 04:49 PM in reply to: hanchris
Glad to knok it help you.



Before google , use the help , at the vlide .



Also the APROPOS and INSPECT



If you have a VL* , just paint it as to select , and pick he help icon .


Valued Contributor
Posts: 90
Registered: ‎06-16-2008
Message 5 of 7 (507 Views)

Re: LISP routine to change Line Width

02-16-2013 03:46 PM in reply to: devitg
hi, any chance anyone can provide me with lisp to chane a line with layer property based on its color? eg. search all layers and if layer color is red (pen1) then make its layer line width xxx and set the plot style to black, if color is yellow ( pen2) then xxx through pen 9 and if pen 10 or higher then set width to default and plot style to color?

i'm moving from ctb to stb plot styles and i figured somthing like this would be the best way to convert old drawings into our new standards... this way i can just set the width"xxx" to that of the current width for that color base.

thanks to anyone that can help with this!!

i also googled like mad and can not find anything...
Paul R. Mascaro
CAD Supervisor | Engineering Design
ENVIRON International Corporation
-----------
System: Dell 6600M
OS | MS Windows 7 64-bit SP1
CPU | Intel Core i7 @ 2.70GHz
RAM | 8.00 GB DDR3 1600 MHz (Dual-Channel @ 798MHz)
Graphics | NVIDIA Quadro 5010M (4 Gig)
Mentor
Posts: 1,678
Registered: ‎03-14-2004
Message 6 of 7 (501 Views)

Re: LISP routine to change Line Width

02-16-2013 04:40 PM in reply to: pmascaro

Hi Paul R. Mascaro, could you upload a sample dwg ?, or send it offline 

Valued Contributor
Posts: 90
Registered: ‎06-16-2008
Message 7 of 7 (491 Views)

Re: LISP routine to change Line Width

02-16-2013 06:15 PM in reply to: hanchris

Thanks Again!!!

Paul R. Mascaro
CAD Supervisor | Engineering Design
ENVIRON International Corporation
-----------
System: Dell 6600M
OS | MS Windows 7 64-bit SP1
CPU | Intel Core i7 @ 2.70GHz
RAM | 8.00 GB DDR3 1600 MHz (Dual-Channel @ 798MHz)
Graphics | NVIDIA Quadro 5010M (4 Gig)

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community