Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

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

LISP routine to change Line Width

929 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
devitg
Posts: 1,704
Registered: ‎03-14-2004
Message 2 of 7 (929 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
hanchris
Posts: 308
Registered: ‎10-24-2007
Message 3 of 7 (929 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
devitg
Posts: 1,704
Registered: ‎03-14-2004
Message 4 of 7 (929 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
pmascaro
Posts: 95
Registered: ‎06-16-2008
Message 5 of 7 (643 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 6800M, OS | MS Windows 7 64-bit SP1, CPU | Intel Core i7 Gen4 @ 3.00GHz Haswell 22nm, RAM | 32.00 GB DDR3 1600 MHz, Graphics | NVIDIA Quadro K5100M (8 Gig), HD | SSD Master, SS Hybrid Secondary
Mentor
devitg
Posts: 1,704
Registered: ‎03-14-2004
Message 6 of 7 (637 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
pmascaro
Posts: 95
Registered: ‎06-16-2008
Message 7 of 7 (627 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 6800M, OS | MS Windows 7 64-bit SP1, CPU | Intel Core i7 Gen4 @ 3.00GHz Haswell 22nm, RAM | 32.00 GB DDR3 1600 MHz, Graphics | NVIDIA Quadro K5100M (8 Gig), HD | SSD Master, SS Hybrid Secondary
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.