Assigning automatically lines to different layers

Assigning automatically lines to different layers

rdellorcoVW4WC
Contributor Contributor
595 Views
4 Replies
Message 1 of 5

Assigning automatically lines to different layers

rdellorcoVW4WC
Contributor
Contributor

Hi,
I am aware this is an old question and I know there is a lisp called layer director (http://www.lee-mac.com/layerdirector.html) or flay (https://apps.autodesk.com/ACD/fr/Detail/Index?id=7021100717958412164&appLang=en&os=Win32_64) that are super tools. But I'm'wondering if is it possible to assign a different layer to different polylines, maybe having a command for every line: for exemple pl1 will draw a polyline on layer 1 and pl2 a polyline on layer 2.
Does this exist or is it possible? I don't know how to write LISP.
Thank you for your help.

0 Likes
596 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

I could easily whip something up, but I suggest you start learning to write AutoLisp routines, since this would be a very basic and easy introduction.  Each command definition with (defun) would involve either a (command) or a (setvar) function to set the correct Layer, and a (command) function to start the PLINE command, and could then just terminate and leave you in that command.

 

Start with that kind of operation, and then if you want to get more sophisticated, you can look at adjusting it to do things like ensure the Layer exists, save the current Layer first and reset that when you're done, draw on the current Layer and change what you've drawn to the desired one, or other approaches.

Kent Cooper, AIA
Message 3 of 5

cadffm
Consultant
Consultant

Hi,

use the TOOLPALETTE feature (and if you run such a tool you linked too parallel, check about possible problems between / untested).

 

Sebastian

Message 4 of 5

rdellorcoVW4WC
Contributor
Contributor

That's nice.'It can be a workaround before I learn Autolisp.
By the way can you assign a key shortcut to the command of the palette?

0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

An extra to the suggestion by Kent before adding a pline, check what was last PLINEX layer created, this way you can close dwg and go to lunch, then open and continue on. 

 

Just a comment not sure how many layers your going to be left with, how many plines involved ? 

0 Likes