Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP routine to change Line Width

6 REPLIES 6
Reply
Message 1 of 7
hanchris
3289 Views, 6 Replies

LISP routine to change Line Width

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
6 REPLIES 6
Message 2 of 7
devitg
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
Message 3 of 7
hanchris
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.
Message 4 of 7
devitg
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 .


Message 5 of 7
pmascaro
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...
Message 6 of 7
devitg
in reply to: pmascaro

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

Message 7 of 7
pmascaro
in reply to: hanchris

Thanks Again!!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost