Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Set Polyline width ByLayer?

mbloswick
Enthusiast

Set Polyline width ByLayer?

mbloswick
Enthusiast
Enthusiast

I'm setting up our template drawing, and I was wondering - is it possible to set polyline width ByLayer?

 

We are going to have separate layers for different pavement markings, and those pavement markings are always going to be polylines with a width. All polylines on "White Solid 4in" will have the same width.  Is there a way I can set that ByLayer, so I don't have to trust my users to set it every time they want to draw a line on the layer? Or is there a way to make some kind of an element template they can use? I really want to avoid everyone having to set everything individually every time because you know some people won't. The more automatic I can make things, the happier we will aLL BE.

 

Alternately, is there a way for me to make a custom linestyle of a set width that I could use?
Thank you.

0 Me gusta
Responder
Soluciones aceptadas (2)
678 Vistas
3 Respuestas
Respuestas (3)

JBerns
Advisor
Advisor
Solución aceptada

My first thought was adding polylines with different properties to a tool palette, but tool palettes do not support preset widths.

 

Next thought would be custom commands to draw polylines on the correct layer and width.

 

For example, this will draw a four-inch wide polyline on the "White Solid 4in" layer.

 

(defun C:WS4 ()
  (setvar "CLAYER" "White Solid 4in")
  (setvar "PLINEWID" 4.0)
  (command-s "_.PLINE")
)

 

Perhaps a community member with AutoCAD reactor experience may suggest some code to automatically set the polyline width based on the current layer.

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional

Valentin-WSP
Mentor
Mentor
Solución aceptada

@mbloswick ,

 

One suggestion would be to Create and included on a Tool Pallettes - then apply a width in the "Tool Properties" Command string - something like what @JBerns mentioned:

 

^C^C(setvar "PLINEWID" 4.0) _pline

 

ValentinWSP_0-1709944272441.png

 

 

 

 

 



Please select the "Accept as Solution" button if my post solves your issue or answers your question.


Emilio Valentin

gonecrawfishin
Enthusiast
Enthusiast

You could create a .ctb file that uses your predefined plotting lineweight for a specific color, set your colors to by layer, and set the layer to that color.

 

Then, the command SETBYLAYER is great when used with quick select to do batch settings to by layer.