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

Need to assign lineweights to layers

28 REPLIES 28
Reply
Message 1 of 29
Brockster
1426 Views, 28 Replies

Need to assign lineweights to layers

I need to change the layer lineweights in many files to match that found in our CAD standards. Typically, we assign lineweight in the CTB file. We now have a client who's standards and CTB file require lineweight to be in the layer setup and not in the CBT. Anyone have a method or lisp to make this adjustment?

So, here's how someone in this forum can help me. I need a program file that will allow me to change only the layer's lineweight based on the assigned color to match my company's CAD standards.

Example:
Layercolor 1 to lineweight 0.35
Layercolor 2 to lineweight 0.25
Layercolor 3 to lineweight 0.50
etc.

Depending on how the program is created, I can add additional text lines for all 255 layercolors. I just need someone to start it for me.

So, can anyone offer out a few keystrokes?
28 REPLIES 28
Message 21 of 29
t.willey
in reply to: Brockster

No, it's like that in 2004. The true color object has the color object within it, but you can get the color object straight from the layer object.

Tim

Command: (setq LayObj (vla-item (vla-get-layers (vla-get-activedocument
(vlax-get-acad-object))) "0"))
#

Command: (dump layobj)
; IAcadLayer: A logical grouping of data, similar to transparent acetate
overlays on a drawing
; Property values:
; Application (RO) = #
; Document (RO) = #
; Freeze = 0
; Handle (RO) = "10"
; HasExtensionDictionary (RO) = 0
; LayerOn = -1
; Linetype = "Continuous"
; Lineweight = -3
; Lock = 0
; Name = "0"
; ObjectID (RO) = 2130111616
; ObjectName (RO) = "AcDbLayerTableRecord"
; OwnerID (RO) = 2130111504
; PlotStyleName = "Color_7"
; Plottable = -1
; TrueColor = #
; ViewportDefault = 0
; Methods supported:
; Delete ()
; GetExtensionDictionary ()
; GetXData (3)
; SetXData (2)
T

Command: (vla-get-color layobj)
7

Command: (dump (vla-get-truecolor layobj))
; IAcadAcCmColor: AutoCAD AcCmColor Interface
; Property values:
; Blue (RO) = 255
; BookName (RO) = ""
; ColorIndex = 7
; ColorMethod = 195
; ColorName (RO) = ""
; EntityColor = -1023410169
; Green (RO) = 255
; Red (RO) = 255
; Methods supported:
; Delete ()
; SetColorBookColor (2)
; SetNames (2)
; SetRGB (3)
T
Message 22 of 29
t.willey
in reply to: Brockster

Thanks for checking that out Jeff. I just copy/pasted what Brockster provided, and assumed it was correct.

Tim
Message 23 of 29
Brockster
in reply to: Brockster

The thread is getting a little skinny, so I'll widen thing out.

Thanks Jeff. I caught the first Line5eight, but didn'trealize there were more within the file. I'll fix and try it again.

AS far as a valid lineweight, how shoud I indicate 1.00. Should it read:vla-put-Lineweight Lay acLnWt100?
Message 24 of 29
t.willey
in reply to: Brockster

It looks like that it what it wants. If you look at the list I provided from the help file, that is one of them.

Tim
Message 25 of 29
Anonymous
in reply to: Brockster

You're welcome. The lineweights are limited to 3 digits, so yes that is how
you'd show that. Note that you also have some LW's that don't exist that may
look correct. The first one I noticed is: acLnWt010, but the only valid LW's
near that size are acLnWt009 & acLnWt013. Agian, there are a number of
these, but if you edit them in the VLIDE you will catch them easily since
valid entries show in blue.

Jeff

wrote in message news:4950748@discussion.autodesk.com...
The thread is getting a little skinny, so I'll widen thing out.

Thanks Jeff. I caught the first Line5eight, but didn'trealize there were
more within the file. I'll fix and try it again.

AS far as a valid lineweight, how shoud I indicate 1.00. Should it
read:vla-put-Lineweight Lay acLnWt100?
Message 26 of 29
Brockster
in reply to: Brockster

It worked, it worked, it worked, it worked, it worked, it worked! Working in the VL program definitely helped. Also, I did realize the lineweights had to be a specific width. Is there a list of the AutoCAD accepted line weigh somewhere to be found?

T.Willey, thanks you for all your hard work on getting this setup for me.

Brock
Message 27 of 29
Anonymous
in reply to: Brockster

Open Acad Help by pressing F1; select the Index Tab; paste this into it:
lineweights, values, table; near the end is an expansion text that will show
you the LW table.


wrote in message news:4950831@discussion.autodesk.com...
It worked, it worked, it worked, it worked, it worked, it worked! Working in
the VL program definitely helped. Also, I did realize the lineweights had to
be a specific width. Is there a list of the AutoCAD accepted line weigh
somewhere to be found?

T.Willey, thanks you for all your hard work on getting this setup for me.

Brock
Message 28 of 29
t.willey
in reply to: Brockster

You're welcome.

Tim
Message 29 of 29
RocksterB
in reply to: t.willey

Time to raise this thread from the dead. I need to change the layer's "VP LineWeight" column so it matches the LineWeight column. It tried looking for the proper name, but with no success.

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

Post to forums  

Autodesk Design & Make Report

”Boost